提交 c1529fa2 编写于 作者: A adam radford 提交者: James Bottomley

[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: NAdam Radford <aradford@gmail.com>
Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
上级 5738f996
...@@ -362,15 +362,20 @@ MR_BuildRaidContext(struct megasas_instance *instance, ...@@ -362,15 +362,20 @@ MR_BuildRaidContext(struct megasas_instance *instance,
/* assume this IO needs the full row - we'll adjust if not true */ /* assume this IO needs the full row - we'll adjust if not true */
regSize = stripSize; regSize = stripSize;
/* If IO spans more than 1 strip, fp is not possible /* Check if we can send this I/O via FastPath */
FP is not possible for writes on non-0 raid levels if (raid->capability.fpCapable) {
FP is not possible if LD is not capable */ if (isRead)
if (num_strips > 1 || (!isRead && raid->level != 0) || io_info->fpOkForIo = (raid->capability.fpReadCapable &&
!raid->capability.fpCapable) { ((num_strips == 1) ||
raid->capability.
fpReadAcrossStripe));
else
io_info->fpOkForIo = (raid->capability.fpWriteCapable &&
((num_strips == 1) ||
raid->capability.
fpWriteAcrossStripe));
} else
io_info->fpOkForIo = FALSE; io_info->fpOkForIo = FALSE;
} else {
io_info->fpOkForIo = TRUE;
}
if (numRows == 1) { if (numRows == 1) {
/* single-strip IOs can always lock only the data needed */ /* single-strip IOs can always lock only the data needed */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册