]> git.karo-electronics.de Git - karo-tx-linux.git/commit
ext4: check for need init flag in ext4_mb_load_buddy
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Thu, 10 Sep 2009 03:34:50 +0000 (23:34 -0400)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 14 Dec 2009 16:06:35 +0000 (08:06 -0800)
commit44373f34a740e9155cc011734ae0342b34e40d2c
tree48f04e4cf4ebbe76716f525c3a5567c959cb8dd6
parentee0cc3fed6eacd6d791b89fa8fd839918e41fefb
ext4: check for need init flag in ext4_mb_load_buddy

(cherry picked from commit f41c0750538667b87a19c93952e5d42fcc069bd7)

We should check for need init flag with the group's alloc_sem held, to
make sure while we are loading the buddy cache and holding a reference
to it, a file system resize can't add new blocks to same group.

The patch also drops the need init flag check in
ext4_mb_regular_allocator() because doing the check without holding
alloc_sem is racy.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/ext4/mballoc.c