summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorNicolas Bretz <bretznic@gmail.com>2024-10-14 06:41:43 +0300
committerTheodore Ts'o <tytso@mit.edu>2024-11-13 07:54:15 +0300
commit97f5ec3b166db4e47ee2c0bdb0deb027413d4f2a (patch)
tree4b9b18d6e78337a0dff3a833ad2d66ba49de876b /fs
parentabe1ac7ca84236513a3d8ede02cc47584437f24f (diff)
downloadlinux-97f5ec3b166db4e47ee2c0bdb0deb027413d4f2a.tar.xz
ext4: prevent delalloc to nodelalloc on remount
Implemented the suggested solution mentioned in the bug https://bugzilla.kernel.org/show_bug.cgi?id=218820 Preventing the disabling of delayed allocation mode on remount. delalloc to nodelalloc not permitted anymore nodelalloc to delalloc permitted, not affected Signed-off-by: Nicolas Bretz <bretznic@gmail.com> Link: https://patch.msgid.link/20241014034143.59779-1-bretznic@gmail.com Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs')
-rw-r--r--fs/ext4/super.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index cb0ce57bd896..33a81ef3c08a 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -6528,6 +6528,13 @@ static int __ext4_remount(struct fs_context *fc, struct super_block *sb)
goto restore_opts;
}
+ if ((old_opts.s_mount_opt & EXT4_MOUNT_DELALLOC) &&
+ !test_opt(sb, DELALLOC)) {
+ ext4_msg(sb, KERN_ERR, "can't disable delalloc during remount");
+ err = -EINVAL;
+ goto restore_opts;
+ }
+
sb->s_flags = (sb->s_flags & ~SB_POSIXACL) |
(test_opt(sb, POSIX_ACL) ? SB_POSIXACL : 0);