* [Cluster-devel] [PATCH] dlm: Avoid that dlm_release_lockspace() incorrectly returns -EBUSY
@ 2013-10-16 12:20 Bart Van Assche
2013-10-16 17:06 ` David Teigland
0 siblings, 1 reply; 2+ messages in thread
From: Bart Van Assche @ 2013-10-16 12:20 UTC (permalink / raw)
To: cluster-devel.redhat.com
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>
Cc: David Teigland <teigland@redhat.com>
---
fs/dlm/lockspace.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/fs/dlm/lockspace.c b/fs/dlm/lockspace.c
index 88556dc..d5abafd 100644
--- a/fs/dlm/lockspace.c
+++ b/fs/dlm/lockspace.c
@@ -706,9 +706,7 @@ static int lkb_idr_is_local(int id, void *p, void *data)
{
struct dlm_lkb *lkb = p;
- if (!lkb->lkb_nodeid)
- return 1;
- return 0;
+ return lkb->lkb_nodeid == 0 && lkb->lkb_grmode != DLM_LOCK_IV;
}
static int lkb_idr_is_any(int id, void *p, void *data)
--
1.8.1.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [Cluster-devel] [PATCH] dlm: Avoid that dlm_release_lockspace() incorrectly returns -EBUSY
2013-10-16 12:20 [Cluster-devel] [PATCH] dlm: Avoid that dlm_release_lockspace() incorrectly returns -EBUSY Bart Van Assche
@ 2013-10-16 17:06 ` David Teigland
0 siblings, 0 replies; 2+ messages in thread
From: David Teigland @ 2013-10-16 17:06 UTC (permalink / raw)
To: cluster-devel.redhat.com
On Wed, Oct 16, 2013 at 02:20:25PM +0200, Bart Van Assche wrote:
> When dlm_release_lockspace(ls, 1) is invoked on a busy system
I've pushed this to the next branch.
Thanks, Dave
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-10-16 17:06 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-16 12:20 [Cluster-devel] [PATCH] dlm: Avoid that dlm_release_lockspace() incorrectly returns -EBUSY Bart Van Assche
2013-10-16 17:06 ` David Teigland
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).