Skip to content

Commit 8813587

Browse files
committed
Revert "ext4: consolidate checks for resize of bigalloc into ext4_resize_begin"
The function ext4_resize_begin() gets called from three different places, and online resize for bigalloc file systems is disallowed from the old-style online resize (EXT4_IOC_GROUP_ADD and EXT4_IOC_GROUP_EXTEND), but it *is* supposed to be allowed via EXT4_IOC_RESIZE_FS. This reverts commit e9f9f61.
1 parent 16aa4c9 commit 8813587

2 files changed

Lines changed: 14 additions & 4 deletions

File tree

fs/ext4/ioctl.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -692,6 +692,13 @@ 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+
695702
err = mnt_want_write_file(file);
696703
if (err)
697704
goto group_add_out;
@@ -914,6 +921,13 @@ static long __ext4_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
914921
goto group_extend_out;
915922
}
916923

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+
917931
err = mnt_want_write_file(filp);
918932
if (err)
919933
goto group_extend_out;

fs/ext4/resize.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,6 @@ 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-
}
8177
if (ext4_has_feature_sparse_super2(sb)) {
8278
ext4_msg(sb, KERN_ERR, "Online resizing not supported with sparse_super2");
8379
return -EOPNOTSUPP;

0 commit comments

Comments
 (0)