]> git.ipfire.org Git - thirdparty/util-linux.git/commit
fsck: fix racing between unlock/unlink and open
authorYuriy M. Kaminskiy <yumkam@gmail.com>
Thu, 7 Apr 2016 21:38:56 +0000 (00:38 +0300)
committerKarel Zak <kzak@redhat.com>
Fri, 22 Apr 2016 09:07:42 +0000 (11:07 +0200)
commitfc75981a229a52ee8f5245c4a036dd151e4a70fc
tree08ab63ac21f698fcb4c71edb0ef5d131f997d742
parent854d0fef7f2bbae6e13a2b2ec8116b7e29541d45
fsck: fix racing between unlock/unlink and open

Process A Process B Process C
open()
[creates file]
lock()
[succeed]
open()
[open existing]
lock()...
running()
close()
[...succeed]
unlink()
running()
open()
[creates file] {BAD!}
lock()
[succeed] {BAD!}
running() {BAD!}
close()

Cons: leaves empty (unlocked/harmless) .lock files in /run/fsck/
Signed-off-by: Yuriy M. Kaminskiy <yumkam@gmail.com>
disk-utils/fsck.c