]> git.baikalelectronics.ru Git - kernel.git/commit
ext4: fix race when setting bitmap_uptodate flag
authorTheodore Ts'o <tytso@mit.edu>
Mon, 20 Feb 2012 22:52:46 +0000 (17:52 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 20 Feb 2012 22:52:46 +0000 (17:52 -0500)
commit8090c09348aab08da3373a668c052f829ee73d17
treecc2d262c0f6524f1a18d2a168d03e2ae3eb624ab
parenta7a46612b29bf3bc570014186826a8bab321ae7f
ext4: fix race when setting bitmap_uptodate flag

In ext4_read_{inode,block}_bitmap() we were setting bitmap_uptodate()
before submitting the buffer for read.  The is bad, since we check
bitmap_uptodate() without locking the buffer, and so if another
process is racing with us, it's possible that they will think the
bitmap is uptodate even though the read has not completed yet,
resulting in inodes and blocks potentially getting allocated more than
once if we get really unlucky.

Addresses-Google-Bug: 2828254

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
fs/ext4/balloc.c
fs/ext4/ext4.h
fs/ext4/ialloc.c
fs/ext4/mballoc.c