summaryrefslogtreecommitdiffstats
path: root/fs/ext4/mballoc.c
diff options
context:
space:
mode:
authorYongqiang Yang <xiaoqiangnk@gmail.com>2012-09-23 23:10:51 -0400
committerTheodore Ts'o <tytso@mit.edu>2012-09-23 23:10:51 -0400
commit838cd0cf9af52e034ee81513642083bbe8e4ddb1 (patch)
tree46d4b49c068756af2bee025caca0759833e39310 /fs/ext4/mballoc.c
parent50df9fd55e4271e89a7adf3b1172083dd0ca199d (diff)
downloadop-kernel-dev-838cd0cf9af52e034ee81513642083bbe8e4ddb1.zip
op-kernel-dev-838cd0cf9af52e034ee81513642083bbe8e4ddb1.tar.gz
ext4: check free block counters in ext4_mb_find_by_goal
Free block counters should be checked before doing allocation. Signed-off-by: Yongqiang Yang <xiaoqiangnk@gmail.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/mballoc.c')
-rw-r--r--fs/ext4/mballoc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index 2c7c082..bb821a9 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -1660,10 +1660,13 @@ int ext4_mb_find_by_goal(struct ext4_allocation_context *ac,
int max;
int err;
struct ext4_sb_info *sbi = EXT4_SB(ac->ac_sb);
+ struct ext4_group_info *grp = ext4_get_group_info(ac->ac_sb, group);
struct ext4_free_extent ex;
if (!(ac->ac_flags & EXT4_MB_HINT_TRY_GOAL))
return 0;
+ if (grp->bb_free == 0)
+ return 0;
err = ext4_mb_load_buddy(ac->ac_sb, group, e4b);
if (err)
OpenPOWER on IntegriCloud