From d919d83359c4f7d3c44f82fba415888142cd76fd Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Fri, 17 Aug 2012 09:46:17 -0400 Subject: [PATCH] --- yaml --- r: 331557 b: refs/heads/master c: 01fc48e8929e45e67527200017cff4e74e4ba054 h: refs/heads/master i: 331555: 3b4672c611ec9e639b9f12dcbdd835e13125c089 v: v3 --- [refs] | 2 +- trunk/fs/ext4/mballoc.c | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index 98337457efbf..83b2dbb073d1 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: ecb94f5fdf4b72547fca022421a9dca1672bddd4 +refs/heads/master: 01fc48e8929e45e67527200017cff4e74e4ba054 diff --git a/trunk/fs/ext4/mballoc.c b/trunk/fs/ext4/mballoc.c index 8eae94771c45..3a57975b73cc 100644 --- a/trunk/fs/ext4/mballoc.c +++ b/trunk/fs/ext4/mballoc.c @@ -1862,6 +1862,12 @@ static int ext4_mb_good_group(struct ext4_allocation_context *ac, BUG_ON(cr < 0 || cr >= 4); + free = grp->bb_free; + if (free == 0) + return 0; + if (cr <= 2 && free < ac->ac_g_ex.fe_len) + return 0; + /* We only do this if the grp has never been initialized */ if (unlikely(EXT4_MB_GRP_NEED_INIT(grp))) { int ret = ext4_mb_init_group(ac->ac_sb, group); @@ -1869,10 +1875,7 @@ static int ext4_mb_good_group(struct ext4_allocation_context *ac, return 0; } - free = grp->bb_free; fragments = grp->bb_fragments; - if (free == 0) - return 0; if (fragments == 0) return 0;