Nothing wrong with fixing it, alhough I don't know exactly
what will be happened if not patching it.

Signed-off-by: Ruoyu <lian...@ucweb.com>
---
 sheep/vdi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sheep/vdi.c b/sheep/vdi.c
index 05cae7b..77dc253 100644
--- a/sheep/vdi.c
+++ b/sheep/vdi.c
@@ -372,11 +372,12 @@ static bool add_new_participant(struct vdi_state_entry 
*entry,
                return true;
        }
 
-       idx = entry->nr_participants++;
+       idx = entry->nr_participants;
        memcpy(&entry->participants[idx], owner, sizeof(*owner));
        entry->participants_state[idx] =
                is_modified(entry) ?
                SHARED_LOCK_STATE_INVALIDATED : SHARED_LOCK_STATE_SHARED;
+       entry->nr_participants++;
 
        sd_debug("new participant %s (%d) joined to VID: %"PRIx32", state is 
%d",
                 node_id_to_str(&entry->participants[idx]), idx, entry->vid,
-- 
1.8.3.2


-- 
sheepdog mailing list
sheepdog@lists.wpkg.org
http://lists.wpkg.org/mailman/listinfo/sheepdog

Reply via email to