public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] fs: ext4: Consolidate checks for resize of bigalloc into ext4_resize_begin
@ 2021-06-07 19:15 Josh Triplett
  2021-06-07 19:15 ` [PATCH 2/2] fs: ext4: Add check to prevent attempting to resize an fs with sparse_super2 Josh Triplett
  2021-06-24 14:23 ` [PATCH 1/2] fs: ext4: Consolidate checks for resize of bigalloc into ext4_resize_begin Theodore Ts'o
  0 siblings, 2 replies; 7+ messages in thread
From: Josh Triplett @ 2021-06-07 19:15 UTC (permalink / raw)
  To: linux-ext4, linux-kernel, Andreas Dilger, Theodore Ts'o

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 <josh@joshtriplett.org>
---
 fs/ext4/ioctl.c  | 14 --------------
 fs/ext4/resize.c |  5 +++++
 2 files changed, 5 insertions(+), 14 deletions(-)

diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c
index 31627f7dc5cd..48a7aace337c 100644
--- a/fs/ext4/ioctl.c
+++ b/fs/ext4/ioctl.c
@@ -693,13 +693,6 @@ static long ext4_ioctl_group_add(struct file *file,
 	if (err)
 		return err;
 
-	if (ext4_has_feature_bigalloc(sb)) {
-		ext4_msg(sb, KERN_ERR,
-			 "Online resizing not supported with bigalloc");
-		err = -EOPNOTSUPP;
-		goto group_add_out;
-	}
-
 	err = mnt_want_write_file(file);
 	if (err)
 		goto group_add_out;
@@ -871,13 +864,6 @@ static long __ext4_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
 			goto group_extend_out;
 		}
 
-		if (ext4_has_feature_bigalloc(sb)) {
-			ext4_msg(sb, KERN_ERR,
-				 "Online resizing not supported with bigalloc");
-			err = -EOPNOTSUPP;
-			goto group_extend_out;
-		}
-
 		err = mnt_want_write_file(filp);
 		if (err)
 			goto group_extend_out;
diff --git a/fs/ext4/resize.c b/fs/ext4/resize.c
index bd0d185654f3..d13bb9e76482 100644
--- a/fs/ext4/resize.c
+++ b/fs/ext4/resize.c
@@ -74,6 +74,11 @@ int ext4_resize_begin(struct super_block *sb)
 		return -EPERM;
 	}
 
+	if (ext4_has_feature_bigalloc(sb)) {
+		ext4_msg(sb, KERN_ERR, "Online resizing not supported with bigalloc");
+		return -EOPNOTSUPP;
+	}
+
 	if (test_and_set_bit_lock(EXT4_FLAGS_RESIZING,
 				  &EXT4_SB(sb)->s_ext4_flags))
 		ret = -EBUSY;
-- 
2.32.0.rc2


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-07-01 14:41 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-06-07 19:15 [PATCH 1/2] fs: ext4: Consolidate checks for resize of bigalloc into ext4_resize_begin Josh Triplett
2021-06-07 19:15 ` [PATCH 2/2] fs: ext4: Add check to prevent attempting to resize an fs with sparse_super2 Josh Triplett
2021-06-24 14:23   ` Theodore Ts'o
2021-06-24 14:23 ` [PATCH 1/2] fs: ext4: Consolidate checks for resize of bigalloc into ext4_resize_begin Theodore Ts'o
2021-07-01  0:48   ` Theodore Ts'o
2021-07-01  2:17     ` Josh Triplett
2021-07-01 14:41       ` Theodore Ts'o

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox