Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lliubbo...
[profile/ivi/kernel-adaptation-intel-automotive.git] / fs / ext4 / ialloc.c
index 26154b8..fa36372 100644 (file)
@@ -697,6 +697,15 @@ got_group:
                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)