]> git.baikalelectronics.ru Git - kernel.git/commit
ocfs2/dlm: Fix race in adding/removing lockres' to/from the tracking list
authorSunil Mushran <sunil.mushran@oracle.com>
Tue, 16 Dec 2008 23:49:22 +0000 (15:49 -0800)
committerMark Fasheh <mfasheh@suse.com>
Mon, 5 Jan 2009 16:40:35 +0000 (08:40 -0800)
commitf71b6e3fabefa13fe26de6f69f5920c9142a5813
tree2e64d3240d6ad879c4ffa1c01ca1696abf3bb2fb
parent74c17c94f4595f0817bab51fb3aea97831958fa2
ocfs2/dlm: Fix race in adding/removing lockres' to/from the tracking list

This patch adds a new lock, dlm->tracking_lock, to protect adding/removing
lockres' to/from the dlm->tracking_list. We were previously using dlm->spinlock
for the same, but that proved inadequate as we could be freeing a lockres from
a context that did not hold that lock. As the new lock only protects this list,
we can explicitly take it when removing the lockres from the tracking list.

This bug was exposed when testing multiple processes concurrently flock() the
same file.

Signed-off-by: Sunil Mushran <sunil.mushran@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
fs/ocfs2/dlm/dlmcommon.h
fs/ocfs2/dlm/dlmdebug.c
fs/ocfs2/dlm/dlmdomain.c
fs/ocfs2/dlm/dlmmaster.c