From ae53e9674ae7f26583fc30574418e5a4908f52fd Mon Sep 17 00:00:00 2001 From: Yongqiang Yang Date: Sun, 23 Sep 2012 23:16:03 -0400 Subject: [PATCH] --- yaml --- r: 331594 b: refs/heads/master c: f2a09af645b762f8230e7eba7fee3b6f7e6e96e7 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/ext4/ialloc.c | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 9df4c9549253..a3108c390bdf 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 838cd0cf9af52e034ee81513642083bbe8e4ddb1 +refs/heads/master: f2a09af645b762f8230e7eba7fee3b6f7e6e96e7 diff --git a/trunk/fs/ext4/ialloc.c b/trunk/fs/ext4/ialloc.c index 26154b81b836..fa36372f3fdf 100644 --- a/trunk/fs/ext4/ialloc.c +++ b/trunk/fs/ext4/ialloc.c @@ -697,6 +697,15 @@ struct inode *ext4_new_inode(handle_t *handle, struct inode *dir, umode_t mode, if (!gdp) goto fail; + /* + * Check free inodes count before loading bitmap. + */ + if (ext4_free_inodes_count(sb, gdp) == 0) { + if (++group == ngroups) + group = 0; + continue; + } + brelse(inode_bitmap_bh); inode_bitmap_bh = ext4_read_inode_bitmap(sb, group); if (!inode_bitmap_bh)