]> git.baikalelectronics.ru Git - kernel.git/commit
dlm: Avoid that dlm_release_lockspace() incorrectly returns -EBUSY
authorBart Van Assche <bvanassche@acm.org>
Wed, 16 Oct 2013 12:20:25 +0000 (14:20 +0200)
committerDavid Teigland <teigland@redhat.com>
Wed, 16 Oct 2013 15:32:42 +0000 (10:32 -0500)
commit6937a3ea7fc120a615aebf9a7ff6b83c3e28c82d
tree8d03d86e9336e219c61a38bb88d2bff4c65ff201
parent373a68d79e60c2369b1b5c9e270f2a02f734941d
dlm: Avoid that dlm_release_lockspace() incorrectly returns -EBUSY

When dlm_release_lockspace(ls, 1) is invoked on a busy system
immediately after the last dlm_unlock() AST has finished it can occur
that lkb_idr_is_local() is invoked for the unlocked LKB since removal
from ls_lkbidr only occurs after the AST has returned. If that happens
dlm_release_lockspace(ls, 1) will return -EBUSY instead of releasing
the lockspace. Fix this race condition by changing lkb_idr_is_local()
such that it only returns true for LKB's that have not yet been
unlocked.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: David Teigland <teigland@redhat.com>
fs/dlm/lockspace.c