summaryrefslogtreecommitdiff
path: root/mdmon.8
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2010-07-28 17:40:54 +1000
committerNeilBrown <neilb@suse.de>2010-07-28 17:40:54 +1000
commit08415c46a867b26743b6b4fc93d5fc6ed027cb07 (patch)
tree3837b21f857b745b978f03642542b2502e3bda7e /mdmon.8
parent93c861ee5752896b340da51afb8ad4db95ae5e3b (diff)
Bugfix: mapfile locking is broken/racy
While we attempt to use a lockfile to grant exclusive access to the mapfile, our implementation is buggy. Specifically, we create a lockfile, then lock it, at which point new instances can open the lockfile and attempt to lock it, which will cause them to block. However, when we are ready to unlock it, we unlink the file. This causes existing lock waiters to get a lock on an unlinked inode while a different instance may now create a new lockfile and get an exclusive lock on it. There are several possible fixes. The chosen one is to test if ->s_nlink is zero after we get the lock and to retry if it isn't. This means: - failing to unlink a file doesn't leave a stale lock - we can block waiting to get a lock rather than busy-waiting - we don't need to leave a lock file permanently in place. Reported-by: Doug Ledford <dledford@redhat.com> Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'mdmon.8')
0 files changed, 0 insertions, 0 deletions