Hi Hitoshi,

+static bool add_new_participant(struct vdi_state_entry *entry,
+                               const struct node_id *owner)
+{
+       int idx;
+
+       if (entry->lock_state == LOCK_STATE_UNLOCKED) {
+               assert(!entry->nr_participants);
+
+               sd_debug("%s is first owner of %"PRIx32, node_id_to_str(owner),
+                       entry->vid);
+
+               entry->nr_participants = 1;
+               memcpy(&entry->participants[0], owner, sizeof(*owner));
+               entry->participants_state[0] = SHARED_LOCK_STATE_MODIFIED;
+               entry->lock_state = LOCK_STATE_SHARED;
+
+               return true;
+       }
+
+       assert(entry->lock_state == LOCK_STATE_UNLOCKED);

It seems the assertion will be failure. Am I misunderstanding?

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

Reply via email to