diff options
author | Doug Ledford <dledford@redhat.com> | 2010-07-20 17:42:26 -0400 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2010-07-22 10:16:31 -0400 |
commit | 56850593049e792c1775047481f814dd444042c5 (patch) | |
tree | b849902282eabc1c8bd3e3284a365452a4a0290d /tests/03r5assemV1 | |
parent | 0155af90d8352d3ca031347e75854b3a5a4052ac (diff) | |
download | mdadm-for-neil.tar.gz mdadm-for-neil.tar.xz mdadm-for-neil.zip |
Bugfix: mapfile locking is broken/racyfor-neil
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 two possible fixes: don't unlink the lock file or require that
the open of the lockfile include the O_CREAT|O_EXCL flags and on EEXIST
retry the open until we either fail for a different error or actually
create the lock file. I implemented the later on the assumption that the
md device map file and therefore the lockfile are on local, early read
write storage (probably a tmpfs of some sort) and therefore not subject
to the problem that it doesn't work over nfs2 or earlier.
In addition add warnings if we ever fail to get a lock when we request it.
Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'tests/03r5assemV1')
0 files changed, 0 insertions, 0 deletions