[sheepdog-users] Possible bug when adding participants to vdi

Hitoshi Mitake mitake.hitoshi at gmail.com
Mon Apr 25 07:09:52 CEST 2016


Hi Vedvyas, sorry for my late reply.

On Sun, Apr 17, 2016 at 12:20 PM, Vedvyas shanbhogue <vedvyas13686 at gmail.com
> wrote:

> This code increments the nr_participants but the participant state is not
> updated yet. The is_modified will now iterate over the updated
> nr_participants and can see bad state in participant_state array.
>
>         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;
>
> A fix may be:
>         idx = entry->nr_participants+ 1;
>         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++;
>
> Please tell me if this would be a good fix.
>
> I was investigating a panic from is_modified where is_valid_shared_state
> finds an invalid shared state - "invalid shared state, two (or more) nodes
> are owning VDI..."
>

Good catch, thanks a lot! Could you create a PR on github for your change?

Thanks,
Hitoshi


>
>
>
> --
> sheepdog-users mailing lists
> sheepdog-users at lists.wpkg.org
> https://lists.wpkg.org/mailman/listinfo/sheepdog-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wpkg.org/pipermail/sheepdog-users/attachments/20160425/511cd05e/attachment.html>


More information about the sheepdog-users mailing list