[PATCH 2/3] megaraid_sas: Add fpRead/WriteCapable, fpRead/WriteAcrossStripe checks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



James/linux-scsi,

The following patch for megaraid_sas fixes the fastpath code decision
logic to use fpRead/WriteCapable, fpRead/WriteAcrossStripe flags
instead of the old logic.  This fixes a bug where fastpath writes
could be sent to a read only LD.

Signed-off-by: Adam Radford <aradford@xxxxxxxxx>

diff -Naur scsi-misc-2.6/drivers/scsi/megaraid/megaraid_sas_fp.c
scsi-misc-2.6.new/drivers/scsi/megaraid/megaraid_sas_fp.c
--- scsi-misc-2.6/drivers/scsi/megaraid/megaraid_sas_fp.c	2012-03-19
17:39:08.313986900 -0700
+++ scsi-misc-2.6.new/drivers/scsi/megaraid/megaraid_sas_fp.c	2012-03-19
17:50:22.484862892 -0700
@@ -362,15 +362,20 @@
 	/* assume this IO needs the full row - we'll adjust if not true */
 	regSize             = stripSize;

-	/* If IO spans more than 1 strip, fp is not possible
-	   FP is not possible for writes on non-0 raid levels
-	   FP is not possible if LD is not capable */
-	if (num_strips > 1 || (!isRead && raid->level != 0) ||
-	    !raid->capability.fpCapable) {
+	/* Check if we can send this I/O via FastPath */
+	if (raid->capability.fpCapable) {
+		if (isRead)
+			io_info->fpOkForIo = (raid->capability.fpReadCapable &&
+					      ((num_strips == 1) ||
+					       raid->capability.
+					       fpReadAcrossStripe));
+		else
+			io_info->fpOkForIo = (raid->capability.fpWriteCapable &&
+					      ((num_strips == 1) ||
+					       raid->capability.
+					       fpWriteAcrossStripe));
+	} else
 		io_info->fpOkForIo = FALSE;
-	} else {
-		io_info->fpOkForIo = TRUE;
-	}

 	if (numRows == 1) {
 		/* single-strip IOs can always lock only the data needed */

Attachment: megaraid_sas.patch2
Description: Binary data


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux