[sheepdog] [PATCH v3 2/5] sheep: don't validate other invalidated nodes

Hitoshi Mitake mitake.hitoshi at lab.ntt.co.jp
Fri Sep 26 04:20:28 CEST 2014


Current inode coherence protocol validates all invalidated nodes when
one node validate itself. This behavior is incorrect so this patch
fixes it.

Signed-off-by: Hitoshi Mitake <mitake.hitoshi at lab.ntt.co.jp>
---
 sheep/vdi.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/sheep/vdi.c b/sheep/vdi.c
index 6d0a80f..2166b74 100644
--- a/sheep/vdi.c
+++ b/sheep/vdi.c
@@ -790,8 +790,18 @@ main_fn int inode_coherence_update(uint32_t vid, bool validate,
 	assert(entry->lock_state == LOCK_STATE_SHARED);
 
 	if (validate) {
-		for (int i = 0; i < entry->nr_participants; i++)
+		for (int i = 0; i < entry->nr_participants; i++) {
+			if (node_id_cmp(&entry->participants[i], sender)
+			    && entry->participants_state[i] ==
+			    SHARED_LOCK_STATE_INVALIDATED)
+				/*
+				 * don't validate other invalidated, they need
+				 * to validate by themselves
+				 */
+				continue;
+
 			entry->participants_state[i] = SHARED_LOCK_STATE_SHARED;
+		}
 	} else {
 		for (int i = 0; i < entry->nr_participants; i++) {
 			if (node_id_cmp(&entry->participants[i], sender))
-- 
1.8.3.2




More information about the sheepdog mailing list