projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
50df9fd
)
ext4: check free block counters in ext4_mb_find_by_goal
author
Yongqiang Yang
<
[email protected]
>
Mon, 24 Sep 2012 03:10:51 +0000
(23:10 -0400)
committer
Theodore Ts'o
<
[email protected]
>
Mon, 24 Sep 2012 03:10:51 +0000
(23:10 -0400)
Free block counters should be checked before doing allocation.
Signed-off-by: Yongqiang Yang <
[email protected]
>
Signed-off-by: "Theodore Ts'o" <
[email protected]
>
fs/ext4/mballoc.c
patch
|
blob
|
history
diff --git
a/fs/ext4/mballoc.c
b/fs/ext4/mballoc.c
index 2c7c082b8169e78d903f3c9ac6640c6442d3544a..bb821a924049b18a21efcc2e79d743b33613e95c 100644
(file)
--- 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)