]> 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>
Tue, 14 Jun 2016 09:22:02 +0000 (11:22 +0200)
commit3c39ff5089b8f5e2f3e8e0879d427fee731e22e8
tree7e3e081c79cf4332297de41872a6db2f731ce8bb
parentb6384d233e300d42d5d39a39ff2c51f3419de639
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