[sheepdog] [PATCH v2 2/5] sheep: don't validate other invalidated nodes
Hitoshi Mitake
mitake.hitoshi at lab.ntt.co.jp
Thu Sep 25 16:11:02 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 f1de98c..78c4134 100644
--- a/sheep/vdi.c
+++ b/sheep/vdi.c
@@ -793,8 +793,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.9.1
More information about the sheepdog
mailing list