summaryrefslogtreecommitdiffstats
path: root/fs/ext4
diff options
context:
space:
mode:
authorWang Shilong <wshilong@ddn.com>2017-08-24 11:58:18 -0400
committerTheodore Ts'o <tytso@mit.edu>2017-08-24 11:58:18 -0400
commit2fe435d8b0746cab8f5e13e1352a22742e84ff1a (patch)
tree9fc738ec95f4e8b442572b75121870477048f19c /fs/ext4
parent4f9d956d1939f97e2cb278b9615b6c683cd90e97 (diff)
downloadlinux-2fe435d8b0746cab8f5e13e1352a22742e84ff1a.tar.gz
linux-2fe435d8b0746cab8f5e13e1352a22742e84ff1a.tar.bz2
linux-2fe435d8b0746cab8f5e13e1352a22742e84ff1a.zip
ext4: cleanup goto next group
avoid duplicated codes, also we need goto next group in case we found reserved inode. Signed-off-by: Wang Shilong <wshilong@ddn.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu> Reviewed-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/ext4')
-rw-r--r--fs/ext4/ialloc.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c
index 0d03e73dccaf..9e6eb1c0e2ee 100644
--- a/fs/ext4/ialloc.c
+++ b/fs/ext4/ialloc.c
@@ -892,19 +892,13 @@ got_group:
/*
* Check free inodes count before loading bitmap.
*/
- if (ext4_free_inodes_count(sb, gdp) == 0) {
- if (++group == ngroups)
- group = 0;
- continue;
- }
+ if (ext4_free_inodes_count(sb, gdp) == 0)
+ goto next_group;
grp = ext4_get_group_info(sb, group);
/* Skip groups with already-known suspicious inode tables */
- if (EXT4_MB_GRP_IBITMAP_CORRUPT(grp)) {
- if (++group == ngroups)
- group = 0;
- continue;
- }
+ if (EXT4_MB_GRP_IBITMAP_CORRUPT(grp))
+ goto next_group;
brelse(inode_bitmap_bh);
inode_bitmap_bh = ext4_read_inode_bitmap(sb, group);
@@ -912,9 +906,7 @@ got_group:
if (EXT4_MB_GRP_IBITMAP_CORRUPT(grp) ||
IS_ERR(inode_bitmap_bh)) {
inode_bitmap_bh = NULL;
- if (++group == ngroups)
- group = 0;
- continue;
+ goto next_group;
}
repeat_in_this_group:
@@ -926,7 +918,7 @@ repeat_in_this_group:
if (group == 0 && (ino+1) < EXT4_FIRST_INO(sb)) {
ext4_error(sb, "reserved inode found cleared - "
"inode=%lu", ino + 1);
- continue;
+ goto next_group;
}
if ((EXT4_SB(sb)->s_journal == NULL) &&
recently_deleted(sb, group, ino)) {