GFS2: Take glock reference in examine_bucket()
authorSteven Whitehouse <swhiteho@redhat.com>
Tue, 20 Aug 2013 08:35:09 +0000 (09:35 +0100)
committerMaciej Wereski <m.wereski@partner.samsung.com>
Tue, 9 Jun 2015 09:30:57 +0000 (11:30 +0200)
commit9f31b1f1af090f1b7cc181d90e13d8da187a8193
tree26031634130a8168de45f6d763a78e05979a2573
parent75851180bc09e7da462b287eaea74ea0647e9eb5
GFS2: Take glock reference in examine_bucket()

We need to check the glock ref counter in a race free way
in order to ensure that the gfs2_glock_hold() call will
succeed. The easiest way to do that is to simply take the
reference count early in the common code of examine_bucket,
skipping any glocks with zero ref count.

That means that the examiner functions all need to put their
reference on the glock once they've performed their function.

Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Reported-by: David Teigland <teigland@redhat.com>
Tested-by: David Teigland <teigland@redhat.com>
fs/gfs2/glock.c