[lvm-devel] [PATCH] (DRAFT!) Fix a deadlock in CLVMD (possibly related to BZ 561226).
Petr Rockai
prockai at redhat.com
Wed Oct 20 13:03:04 UTC 2010
Milan Broz <mbroz at redhat.com> writes:
> p.s.
> nitpicking
>
> DEBUGLOG("in sub thread: client = %p\n", client);
> + pthread_mutex_lock(&client->bits.localsock.mutex);
>
> /* Don't start until the LVM thread is ready */
> pthread_mutex_lock(&lvm_start_mutex);
> pthread_mutex_unlock(&lvm_start_mutex);
> DEBUGLOG("Sub thread ready for work.\n");
>
>
> Can we move that localsock.muext lock after the lvm_start_mutex exercise?
> (Which I do not like either - isn't cond wait better for that?)
I would be actually wary about that -- I suspect that going the other
way around could introduce a (very slight) race condition. Not that it
would ever happen in practice, but still. On the other hand, I didn't
try too hard to think about it, so I might be wrong.
Yours,
Petr.
More information about the lvm-devel
mailing list