[PATCH] sheepdog: fix to clear create flag when reloading inode

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

 



This bug causes duplicated CREATE_AND_WRITE requests
in case of iSCSI multipath failover.

Signed-off-by: YAMADA Hideki <yamada.hideki@xxxxxxxxxxxxx>
---
 usr/bs_sheepdog.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/usr/bs_sheepdog.c b/usr/bs_sheepdog.c
index ba5b099..2941803 100644
--- a/usr/bs_sheepdog.c
+++ b/usr/bs_sheepdog.c
@@ -858,7 +858,7 @@ static int sd_io(struct sheepdog_access_info *ai, int write, char *buf, int len,
 		(offset + len + (SD_DATA_OBJ_SIZE - 1)) / SD_DATA_OBJ_SIZE;
 	unsigned obj_offset = offset % SD_DATA_OBJ_SIZE;
 	size_t orig_size, size, rest = len;
-	int ret = 0, create = 0;
+	int ret = 0, create;
 	uint64_t oid, old_oid;
 	uint16_t flags = 0;
 	int need_update_inode = 0, need_reload_inode;
@@ -899,6 +899,7 @@ retry:
 			 * always turn on cache of sheep layer
 			 */
 			flags = SD_FLAG_CMD_CACHE;
+			create = 0;
 
 			if (ai->inode.data_vdi_id[idx] != vid) {
 				create = 1;
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux SCSI]     [Linux RAID]     [Linux Clusters]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]

  Powered by Linux