Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Kubecek <mkubecek@suse.cz>2019-10-02 07:18:54 +0200
committerMichal Kubecek <mkubecek@suse.cz>2019-10-02 07:18:54 +0200
commit599ca8a655dfa91d8ed789528f9099a92b14a123 (patch)
treed252b9e748669c272631a9698a420f209bae7943
parent282243036c3e002fa178ac586144c8f0991ec70f (diff)
parentb34f3cbd279890081e39082ef8ce2753b235fc6e (diff)
Merge branch 'users/lduncan/SLE15-SP2/for-next' into SLE15-SP2
Pull SP1 patch cleanup from Lee Duncan.
-rw-r--r--patches.suse/target-transport-should-handle-st-FM-EOM-ILI-reads.patch178
-rw-r--r--series.conf2
2 files changed, 0 insertions, 180 deletions
diff --git a/patches.suse/target-transport-should-handle-st-FM-EOM-ILI-reads.patch b/patches.suse/target-transport-should-handle-st-FM-EOM-ILI-reads.patch
deleted file mode 100644
index 2c2409d1cf..0000000000
--- a/patches.suse/target-transport-should-handle-st-FM-EOM-ILI-reads.patch
+++ /dev/null
@@ -1,178 +0,0 @@
-From b39f109e0d4abdb48d7d00b355a0d7bb808a13cf Mon Sep 17 00:00:00 2001
-From: Lee Duncan <lduncan@suse.com>
-Date: Tue, 15 May 2018 18:11:53 -0700
-Subject: [PATCH] target: transport should handle st FM/EOM/ILI reads
-Patch-mainline: Submitted, linux-scsi ML
-References: bsc#1081599
-
-When a tape drive is exported via LIO using the pscsi module, a read that
-requests more bytes per block than the tape can supply returns an empty
-buffer. This is because the pscsi pass-through target module sees the
-"ILI" illegal length bit set and thinks there is no reason to return
-the data.
-
-This is a long-standing transport issue, since it assumes that no data
-need be returned under a check condition, which isn't always the case
-for tape.
-
-Add in a check for tape reads with the ILI, EOM, or FM bits set,
-with a sense code of NO_SENSE, treating such cases as if the read
-succeeded. The layered tape driver then "does the right thing" when
-it gets such a response.
-
-Changes from v3:
- - cleaned up comment
- - Added residual handling
-
-Changes from v2:
- - Cleaned up subject line and bug text formatting
- - Removed unneeded inner braces
- - Removed ugly goto
- - Also updated the "queue full" path to handle this case
-
-Changes from RFC:
- - Moved ugly code from transport to pscsi module
- - Added checking EOM and FM bits, as well as ILI
- - fixed malformed patch
- - Clarified description a bit
-
-Signed-off-by: Lee Duncan <lduncan@suse.com>
-Signed-off-by: Bodo Stroesser <bstroesser@ts.fujitsu.com>
-Reviewed-by: Hannes Reinecke <hare@suse.com>
----
- drivers/target/target_core_pscsi.c | 26 ++++++++++++++++++-
- drivers/target/target_core_transport.c | 43 ++++++++++++++++++++++++++++-----
- include/target/target_core_base.h | 1
- 3 files changed, 62 insertions(+), 8 deletions(-)
-
---- a/drivers/target/target_core_pscsi.c
-+++ b/drivers/target/target_core_pscsi.c
-@@ -689,8 +689,29 @@ after_mode_sense:
- }
- after_mode_select:
-
-- if (scsi_status == SAM_STAT_CHECK_CONDITION)
-+ if (scsi_status == SAM_STAT_CHECK_CONDITION) {
- transport_copy_sense_to_cmd(cmd, req_sense);
-+
-+ /*
-+ * check for TAPE device reads with
-+ * FM/EOM/ILI set, so that we can get data
-+ * back despite framework assumption that a
-+ * check condition means there is no data
-+ */
-+ if (sd->type == TYPE_TAPE &&
-+ cmd->data_direction == DMA_FROM_DEVICE) {
-+ /*
-+ * is sense data valid, fixed format,
-+ * and have FM, EOM, or ILI set?
-+ */
-+ if (req_sense[0] == 0xf0 && /* valid, fixed format */
-+ req_sense[2] & 0xe0 && /* FM, EOM, or ILI */
-+ (req_sense[2] & 0xf) == 0) { /* key==NO_SENSE */
-+ pr_debug("Tape FM/EOM/ILI status detected. Treat as normal read.\n");
-+ cmd->se_cmd_flags |= SCF_TREAT_READ_AS_NORMAL;
-+ }
-+ }
-+ }
- }
-
- enum {
-@@ -1061,7 +1082,8 @@ static void pscsi_req_done(struct reques
-
- switch (host_byte(result)) {
- case DID_OK:
-- target_complete_cmd(cmd, scsi_status);
-+ target_complete_cmd_with_length(cmd, scsi_status,
-+ cmd->data_length - scsi_req(req)->resid_len);
- break;
- default:
- pr_debug("PSCSI Host Byte exception at cmd: %p CDB:"
---- a/drivers/target/target_core_transport.c
-+++ b/drivers/target/target_core_transport.c
-@@ -795,7 +795,9 @@ EXPORT_SYMBOL(target_complete_cmd_with_s
-
- void target_complete_cmd_with_length(struct se_cmd *cmd, u8 scsi_status, int length)
- {
-- if (scsi_status == SAM_STAT_GOOD && length < cmd->data_length) {
-+ if ((scsi_status == SAM_STAT_GOOD ||
-+ cmd->se_cmd_flags & SCF_TREAT_READ_AS_NORMAL) &&
-+ length < cmd->data_length) {
- if (cmd->se_cmd_flags & SCF_UNDERFLOW_BIT) {
- cmd->residual_count += cmd->data_length - length;
- } else {
-@@ -2090,12 +2092,24 @@ static void transport_complete_qf(struct
- goto queue_status;
- }
-
-- if (cmd->se_cmd_flags & SCF_TRANSPORT_TASK_SENSE)
-+ /*
-+ * Check if we need to send a sense buffer from
-+ * the struct se_cmd in question. We do NOT want
-+ * to take this path of the IO has been marked as
-+ * needing to be treated like a "normal read". This
-+ * is the case if it's a tape read, and either the
-+ * FM, EOM, or ILI bits are set, but there is no
-+ * sense data.
-+ */
-+ if (!(cmd->se_cmd_flags & SCF_TREAT_READ_AS_NORMAL) &&
-+ cmd->se_cmd_flags & SCF_TRANSPORT_TASK_SENSE)
- goto queue_status;
-
- switch (cmd->data_direction) {
- case DMA_FROM_DEVICE:
-- if (cmd->scsi_status)
-+ /* queue status if not treating this as a normal read */
-+ if (cmd->scsi_status &&
-+ !(cmd->se_cmd_flags & SCF_TREAT_READ_AS_NORMAL))
- goto queue_status;
-
- trace_target_cmd_complete(cmd);
-@@ -2200,9 +2214,15 @@ static void target_complete_ok_work(stru
-
- /*
- * Check if we need to send a sense buffer from
-- * the struct se_cmd in question.
-+ * the struct se_cmd in question. We do NOT want
-+ * to take this path of the IO has been marked as
-+ * needing to be treated like a "normal read". This
-+ * is the case if it's a tape read, and either the
-+ * FM, EOM, or ILI bits are set, but there is no
-+ * sense data.
- */
-- if (cmd->se_cmd_flags & SCF_TRANSPORT_TASK_SENSE) {
-+ if (!(cmd->se_cmd_flags & SCF_TREAT_READ_AS_NORMAL) &&
-+ cmd->se_cmd_flags & SCF_TRANSPORT_TASK_SENSE) {
- WARN_ON(!cmd->scsi_status);
- ret = transport_send_check_condition_and_sense(
- cmd, 0, 1);
-@@ -2244,7 +2264,18 @@ static void target_complete_ok_work(stru
- queue_rsp:
- switch (cmd->data_direction) {
- case DMA_FROM_DEVICE:
-- if (cmd->scsi_status)
-+ /*
-+ * if this is a READ-type IO, but SCSI status
-+ * is set, then skip returning data and just
-+ * return the status -- unless this IO is marked
-+ * as needing to be treated as a normal read,
-+ * in which case we want to go ahead and return
-+ * the data. This happens, for example, for tape
-+ * reads with the FM, EOM, or ILI bits set, with
-+ * no sense data.
-+ */
-+ if (cmd->scsi_status &&
-+ !(cmd->se_cmd_flags & SCF_TREAT_READ_AS_NORMAL))
- goto queue_status;
-
- atomic_long_add(cmd->data_length,
---- a/include/target/target_core_base.h
-+++ b/include/target/target_core_base.h
-@@ -144,6 +144,7 @@ enum se_cmd_flags_table {
- SCF_ACK_KREF = 0x00400000,
- SCF_USE_CPUID = 0x00800000,
- SCF_TASK_ATTR_SET = 0x01000000,
-+ SCF_TREAT_READ_AS_NORMAL = 0x02000000,
- };
-
- /*
diff --git a/series.conf b/series.conf
index 41c57ce652..e75bab1a2d 100644
--- a/series.conf
+++ b/series.conf
@@ -657,8 +657,6 @@
+jlee patches.suse/0055-acpi-Ignore-acpi_rsdp-kernel-param-when-the-kernel-h.patch
+jlee patches.suse/0056-acpi-Disable-ACPI-table-override-if-the-kernel-is-lo.patch
+jlee patches.suse/0057-acpi-Disable-APEI-error-injection-if-the-kernel-is-l.patch
-# lduncan
-+lduncan patches.suse/target-transport-should-handle-st-FM-EOM-ILI-reads.patch
# lhenriques
+lhenriques patches.suse/rbd-add-support-for-COMPARE_AND_WRITE-CMPEXT.patch
+lhenriques patches.suse/rbd-add-support-for-scatterlist-obj_request_type.patch