aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/megaraid
diff options
context:
space:
mode:
authoradam radford <aradford@gmail.com>2012-03-19 22:50:00 -0400
committerJames Bottomley <JBottomley@Parallels.com>2012-04-23 14:26:18 -0400
commitc1529fa25e20f4c5d92d82165a8ff5fe27eae974 (patch)
treeb4cc4d32871991915cb9fcb9cd3e08cb25cac34a /drivers/scsi/megaraid
parent5738f996432589eebe88db21f4a9cb8ee5f04872 (diff)
[SCSI] megaraid_sas: Add fpRead/WriteCapable, fpRead/WriteAcrossStripe checks
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@gmail.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/megaraid')
-rw-r--r--drivers/scsi/megaraid/megaraid_sas_fp.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/drivers/scsi/megaraid/megaraid_sas_fp.c b/drivers/scsi/megaraid/megaraid_sas_fp.c
index 294abb0defa6..e3d251a2e26a 100644
--- a/drivers/scsi/megaraid/megaraid_sas_fp.c
+++ b/drivers/scsi/megaraid/megaraid_sas_fp.c
@@ -362,15 +362,20 @@ MR_BuildRaidContext(struct megasas_instance *instance,
362 /* assume this IO needs the full row - we'll adjust if not true */ 362 /* assume this IO needs the full row - we'll adjust if not true */
363 regSize = stripSize; 363 regSize = stripSize;
364 364
365 /* If IO spans more than 1 strip, fp is not possible 365 /* Check if we can send this I/O via FastPath */
366 FP is not possible for writes on non-0 raid levels 366 if (raid->capability.fpCapable) {
367 FP is not possible if LD is not capable */ 367 if (isRead)
368 if (num_strips > 1 || (!isRead && raid->level != 0) || 368 io_info->fpOkForIo = (raid->capability.fpReadCapable &&
369 !raid->capability.fpCapable) { 369 ((num_strips == 1) ||
370 raid->capability.
371 fpReadAcrossStripe));
372 else
373 io_info->fpOkForIo = (raid->capability.fpWriteCapable &&
374 ((num_strips == 1) ||
375 raid->capability.
376 fpWriteAcrossStripe));
377 } else
370 io_info->fpOkForIo = FALSE; 378 io_info->fpOkForIo = FALSE;
371 } else {
372 io_info->fpOkForIo = TRUE;
373 }
374 379
375 if (numRows == 1) { 380 if (numRows == 1) {
376 /* single-strip IOs can always lock only the data needed */ 381 /* single-strip IOs can always lock only the data needed */