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 <[email protected]>
Signed-off-by: Hitoshi Mitake <[email protected]>
---
 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

-- 
sheepdog mailing list
[email protected]
https://lists.wpkg.org/mailman/listinfo/sheepdog

Reply via email to