[sheepdog] [PATCH stable-0.9 1/4] sheep: invalidate inode status of other nodes before actual write

Hitoshi Mitake mitake.hitoshi at lab.ntt.co.jp
Wed Dec 24 16:20:19 CET 2014


Current iscsi coherence protocol can cause inconsistency when a
gateway sheep process dies between inode update and invalidation.

This patch makes sure that inode update must cause invalidation even
if sheep dies before actual inode.

Tested-by: YAMADA Hideki <yamada.hideki at lab.ntt.co.jp>
Signed-off-by: Hitoshi Mitake <mitake.hitoshi at lab.ntt.co.jp>
---
 sheep/gateway.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/sheep/gateway.c b/sheep/gateway.c
index a5cee5c..7f7d1d1 100644
--- a/sheep/gateway.c
+++ b/sheep/gateway.c
@@ -681,6 +681,9 @@ int gateway_write_obj(struct request *req)
 	if (!bypass_object_cache(req))
 		return object_cache_handle_request(req);
 
+	if (is_data_vid_update(hdr))
+		invalidate_other_nodes(oid_to_vid(oid));
+
 	if (is_data_vid_update(hdr)) {
 		size_t nr_vids = hdr->data_length / sizeof(*vids);
 
@@ -701,8 +704,6 @@ int gateway_write_obj(struct request *req)
 		update_obj_refcnt(hdr, vids, new_vids, refs);
 	}
 out:
-	if (is_data_vid_update(hdr))
-		invalidate_other_nodes(oid_to_vid(oid));
 
 	free(vids);
 	free(refs);
-- 
1.9.1




More information about the sheepdog mailing list