diff options
author | David Teigland <teigland@redhat.com> | 2010-02-24 20:08:18 +0300 |
---|---|---|
committer | David Teigland <teigland@redhat.com> | 2010-02-24 20:46:53 +0300 |
commit | 7fe2b3190b8b299409f13cf3a6f85c2bd371f8bb (patch) | |
tree | 36af13880f834cd1c7fd92200ebcc33c64d9edf0 /fs/dlm/lock.c | |
parent | b0483e78e5c4c9871fc5541875b3bc006846d46b (diff) | |
download | linux-7fe2b3190b8b299409f13cf3a6f85c2bd371f8bb.tar.xz |
dlm: fix ordering of bast and cast
When both blocking and completion callbacks are queued for lock,
the dlm would always deliver the completion callback (cast) first.
In some cases the blocking callback (bast) is queued before the
cast, though, and should be delivered first. This patch keeps
track of the order in which they were queued and delivers them
in that order.
This patch also keeps track of the granted mode in the last cast
and eliminates the following bast if the bast mode is compatible
with the preceding cast mode. This happens when a remotely mastered
lock is demoted, e.g. EX->NL, in which case the local node queues
a cast immediately after sending the demote message. In this way
a cast can be queued for a mode, e.g. NL, that makes an in-transit
bast extraneous.
Signed-off-by: David Teigland <teigland@redhat.com>
Diffstat (limited to 'fs/dlm/lock.c')
-rw-r--r-- | fs/dlm/lock.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/dlm/lock.c b/fs/dlm/lock.c index 9c0c1db1e105..e08ea93432bc 100644 --- a/fs/dlm/lock.c +++ b/fs/dlm/lock.c @@ -1,7 +1,7 @@ /****************************************************************************** ******************************************************************************* ** -** Copyright (C) 2005-2008 Red Hat, Inc. All rights reserved. +** Copyright (C) 2005-2010 Red Hat, Inc. All rights reserved. ** ** This copyrighted material is made available to anyone wishing to use, ** modify, copy, or redistribute it subject to the terms and conditions @@ -307,7 +307,7 @@ static void queue_cast(struct dlm_rsb *r, struct dlm_lkb *lkb, int rv) lkb->lkb_lksb->sb_status = rv; lkb->lkb_lksb->sb_flags = lkb->lkb_sbflags; - dlm_add_ast(lkb, AST_COMP, 0); + dlm_add_ast(lkb, AST_COMP, lkb->lkb_grmode); } static inline void queue_cast_overlap(struct dlm_rsb *r, struct dlm_lkb *lkb) |