]> git.ipfire.org Git - thirdparty/mdadm.git/commit
mapfile: fix locking.
authorNeilBrown <neilb@suse.de>
Fri, 29 Jan 2010 05:20:08 +0000 (16:20 +1100)
committerNeilBrown <neilb@suse.de>
Fri, 29 Jan 2010 05:20:08 +0000 (16:20 +1100)
commitfc7e81e54ec37ece4f1a8ec1729933fc22ec25ff
tree43c375e4db15bf5f18c49afbcafc473792c89cdb
parentd998adc316299efc44cb6e70ecc2e04bffb76d17
mapfile: fix locking.

The current locking uses lockf, and is completely broken.
When you hold a lockf lock, any close of any fd on that file will
release the lock.  So map_read() call which is made as soon as we get
the lock, will immediately drop the lock.

So change to flock locking which isn't so badly designed.

Signed-off-by: NeilBrown <neilb@suse.de>
mapfile.c