Skip to content

Commit e9f9f61

Browse files
joshtripletttytso
authored andcommitted
ext4: consolidate checks for resize of bigalloc into ext4_resize_begin
Two different places checked for attempts to resize a filesystem with the bigalloc feature. Move the check into ext4_resize_begin, which both places already call. Signed-off-by: Josh Triplett <[email protected]> Link: https://lore.kernel.org/r/bee03303d999225ecb3bfa5be8576b2f4c6edbe6.1623093259.git.josh@joshtriplett.org Signed-off-by: Theodore Ts'o <[email protected]>
1 parent 310c097 commit e9f9f61

File tree

2 files changed

+5
-14
lines changed

2 files changed

+5
-14
lines changed

fs/ext4/ioctl.c

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -692,13 +692,6 @@ static long ext4_ioctl_group_add(struct file *file,
692692
if (err)
693693
return err;
694694

695-
if (ext4_has_feature_bigalloc(sb)) {
696-
ext4_msg(sb, KERN_ERR,
697-
"Online resizing not supported with bigalloc");
698-
err = -EOPNOTSUPP;
699-
goto group_add_out;
700-
}
701-
702695
err = mnt_want_write_file(file);
703696
if (err)
704697
goto group_add_out;
@@ -921,13 +914,6 @@ static long __ext4_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
921914
goto group_extend_out;
922915
}
923916

924-
if (ext4_has_feature_bigalloc(sb)) {
925-
ext4_msg(sb, KERN_ERR,
926-
"Online resizing not supported with bigalloc");
927-
err = -EOPNOTSUPP;
928-
goto group_extend_out;
929-
}
930-
931917
err = mnt_want_write_file(filp);
932918
if (err)
933919
goto group_extend_out;

fs/ext4/resize.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,11 @@ int ext4_resize_begin(struct super_block *sb)
7474
return -EPERM;
7575
}
7676

77+
if (ext4_has_feature_bigalloc(sb)) {
78+
ext4_msg(sb, KERN_ERR, "Online resizing not supported with bigalloc");
79+
return -EOPNOTSUPP;
80+
}
81+
7782
if (test_and_set_bit_lock(EXT4_FLAGS_RESIZING,
7883
&EXT4_SB(sb)->s_ext4_flags))
7984
ret = -EBUSY;

0 commit comments

Comments
 (0)