dlm: fix ordering of bast and cast
authorDavid Teigland <teigland@redhat.com>
Wed, 24 Feb 2010 17:08:18 +0000 (11:08 -0600)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 13 Aug 2010 20:20:20 +0000 (13:20 -0700)
commit6ce7a93b30612fd11301dbbafaac8ae01497054d
treebd49a9d9d4e727fe27e127715551fda17b83dd93
parentd53f591280e8ad6a3164534db63b8c511154c704
dlm: fix ordering of bast and cast

commit 7fe2b3190b8b299409f13cf3a6f85c2bd371f8bb upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/dlm/ast.c
fs/dlm/ast.h
fs/dlm/dlm_internal.h
fs/dlm/lock.c
fs/dlm/user.c
fs/dlm/user.h