[PATCH] target/iblock: Fix WCE=1 + DPOFUA=1 backend WRITE regression

15 views
Skip to first unread message

Nicholas A. Bellinger

unread,
May 15, 2013, 2:36:14 AM5/15/13
to target-devel, Nicholas Bellinger, Chris Boot, Hannes Reinecke
From: Nicholas Bellinger <n...@linux-iscsi.org>

This patch fixes a regression bug introduced in v3.9-rc1 where if the
underlying struct block_device for a IBLOCK backend is configured with
WCE=1 + DPOFUA=1 settings, the rw = WRITE assignment no longer occurs
in iblock_execute_rw(), and rw = 0 is passed to iblock_submit_bios()
in effect causing a READ bio operation to occur.

The offending commit is:

commit d0c8b259f8970d39354c1966853363345d401330
Author: Nicholas Bellinger <n...@linux-iscsi.org>
Date: Tue Jan 29 22:10:06 2013 -0800

target/iblock: Use backend REQ_FLUSH hint for WriteCacheEnabled status

Note the WCE=1 + DPOFUA=0, WCE=0 + DPOFUA=1, and WCE=0 + DPOFUA=0 cases
are not affected by this regression bug.

Reported-by: Chris Boot <bo...@bootc.net>
Cc: Chris Boot <bo...@bootc.net>
Reported-by: Hannes Reinecke <ha...@suse.de>
Cc: Hannes Reinecke <ha...@suse.de>
Signed-off-by: Nicholas Bellinger <n...@linux-iscsi.org>
---
drivers/target/target_core_iblock.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/target/target_core_iblock.c b/drivers/target/target_core_iblock.c
index 07f5f94..aa1620a 100644
--- a/drivers/target/target_core_iblock.c
+++ b/drivers/target/target_core_iblock.c
@@ -615,6 +615,8 @@ iblock_execute_rw(struct se_cmd *cmd)
rw = WRITE_FUA;
else if (!(q->flush_flags & REQ_FLUSH))
rw = WRITE_FUA;
+ else
+ rw = WRITE;
} else {
rw = WRITE;
}
--
1.7.2.5

Reply all
Reply to author
Forward
0 new messages