From: Greg Kroah-Hartman Date: Mon, 14 Nov 2016 07:41:21 +0000 (+0100) Subject: 4.8-stable patches X-Git-Tag: v4.4.32~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=41c2e9d6e1b81e3b22f34483dafb52967f93d747;p=thirdparty%2Fkernel%2Fstable-queue.git 4.8-stable patches added patches: scsi-megaraid_sas-fix-data-integrity-failure-for-jbod-passthrough-devices.patch scsi-megaraid_sas-fix-macro-megasas_is_logical-to-avoid-regression.patch --- diff --git a/queue-4.8/scsi-megaraid_sas-fix-data-integrity-failure-for-jbod-passthrough-devices.patch b/queue-4.8/scsi-megaraid_sas-fix-data-integrity-failure-for-jbod-passthrough-devices.patch new file mode 100644 index 00000000000..238fbcefffa --- /dev/null +++ b/queue-4.8/scsi-megaraid_sas-fix-data-integrity-failure-for-jbod-passthrough-devices.patch @@ -0,0 +1,55 @@ +From 1e793f6fc0db920400574211c48f9157a37e3945 Mon Sep 17 00:00:00 2001 +From: Kashyap Desai +Date: Fri, 21 Oct 2016 06:33:32 -0700 +Subject: scsi: megaraid_sas: Fix data integrity failure for JBOD (passthrough) devices + +From: Kashyap Desai + +commit 1e793f6fc0db920400574211c48f9157a37e3945 upstream. + +Commit 02b01e010afe ("megaraid_sas: return sync cache call with +success") modified the driver to successfully complete SYNCHRONIZE_CACHE +commands without passing them to the controller. Disk drive caches are +only explicitly managed by controller firmware when operating in RAID +mode. So this commit effectively disabled writeback cache flushing for +any drives used in JBOD mode, leading to data integrity failures. + +[mkp: clarified patch description] + +Fixes: 02b01e010afeeb49328d35650d70721d2ca3fd59 +Signed-off-by: Kashyap Desai +Signed-off-by: Sumit Saxena +Reviewed-by: Tomas Henzl +Reviewed-by: Hannes Reinecke +Reviewed-by: Ewan D. Milne +Signed-off-by: Martin K. Petersen +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/scsi/megaraid/megaraid_sas_base.c | 13 +++++-------- + 1 file changed, 5 insertions(+), 8 deletions(-) + +--- a/drivers/scsi/megaraid/megaraid_sas_base.c ++++ b/drivers/scsi/megaraid/megaraid_sas_base.c +@@ -1713,16 +1713,13 @@ megasas_queue_command(struct Scsi_Host * + goto out_done; + } + +- switch (scmd->cmnd[0]) { +- case SYNCHRONIZE_CACHE: +- /* +- * FW takes care of flush cache on its own +- * No need to send it down +- */ ++ /* ++ * FW takes care of flush cache on its own for Virtual Disk. ++ * No need to send it down for VD. For JBOD send SYNCHRONIZE_CACHE to FW. ++ */ ++ if ((scmd->cmnd[0] == SYNCHRONIZE_CACHE) && MEGASAS_IS_LOGICAL(scmd)) { + scmd->result = DID_OK << 16; + goto out_done; +- default: +- break; + } + + return instance->instancet->build_and_issue_cmd(instance, scmd); diff --git a/queue-4.8/scsi-megaraid_sas-fix-macro-megasas_is_logical-to-avoid-regression.patch b/queue-4.8/scsi-megaraid_sas-fix-macro-megasas_is_logical-to-avoid-regression.patch new file mode 100644 index 00000000000..7a68c612723 --- /dev/null +++ b/queue-4.8/scsi-megaraid_sas-fix-macro-megasas_is_logical-to-avoid-regression.patch @@ -0,0 +1,45 @@ +From 5e5ec1759dd663a1d5a2f10930224dd009e500e8 Mon Sep 17 00:00:00 2001 +From: Sumit Saxena +Date: Wed, 9 Nov 2016 02:59:42 -0800 +Subject: scsi: megaraid_sas: fix macro MEGASAS_IS_LOGICAL to avoid regression + +From: Sumit Saxena + +commit 5e5ec1759dd663a1d5a2f10930224dd009e500e8 upstream. + +This patch will fix regression caused by commit 1e793f6fc0db ("scsi: +megaraid_sas: Fix data integrity failure for JBOD (passthrough) +devices"). + +The problem was that the MEGASAS_IS_LOGICAL macro did not have braces +and as a result the driver ended up exposing a lot of non-existing SCSI +devices (all SCSI commands to channels 1,2,3 were returned as +SUCCESS-DID_OK by driver). + +[mkp: clarified patch description] + +Fixes: 1e793f6fc0db920400574211c48f9157a37e3945 +Reported-by: Jens Axboe +Signed-off-by: Kashyap Desai +Signed-off-by: Sumit Saxena +Tested-by: Sumit Saxena +Reviewed-by: Tomas Henzl +Tested-by: Jens Axboe +Signed-off-by: Martin K. Petersen +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/scsi/megaraid/megaraid_sas.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/scsi/megaraid/megaraid_sas.h ++++ b/drivers/scsi/megaraid/megaraid_sas.h +@@ -2233,7 +2233,7 @@ struct megasas_instance_template { + }; + + #define MEGASAS_IS_LOGICAL(scp) \ +- (scp->device->channel < MEGASAS_MAX_PD_CHANNELS) ? 0 : 1 ++ ((scp->device->channel < MEGASAS_MAX_PD_CHANNELS) ? 0 : 1) + + #define MEGASAS_DEV_INDEX(scp) \ + (((scp->device->channel % 2) * MEGASAS_MAX_DEV_PER_CHANNEL) + \ diff --git a/queue-4.8/series b/queue-4.8/series index 3630a6c4ce4..c6f58bad83e 100644 --- a/queue-4.8/series +++ b/queue-4.8/series @@ -33,3 +33,5 @@ ip6_tunnel-update-skb-protocol-to-eth_p_ipv6-in-ip6_tnl_xmit.patch packet-on-direct_xmit-limit-tso-and-csum-to-supported-devices.patch arch-powerpc-update-parameters-for-csum_tcpudp_magic-csum_tcpudp_nofold.patch usb-dwc3-gadget-properly-account-queued-requests.patch +scsi-megaraid_sas-fix-data-integrity-failure-for-jbod-passthrough-devices.patch +scsi-megaraid_sas-fix-macro-megasas_is_logical-to-avoid-regression.patch