Skip to content

Commit 97f5ec3

Browse files
nicbretztytso
authored andcommitted
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 <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Theodore Ts'o <[email protected]>
1 parent abe1ac7 commit 97f5ec3

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

fs/ext4/super.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6528,6 +6528,13 @@ static int __ext4_remount(struct fs_context *fc, struct super_block *sb)
65286528
goto restore_opts;
65296529
}
65306530

6531+
if ((old_opts.s_mount_opt & EXT4_MOUNT_DELALLOC) &&
6532+
!test_opt(sb, DELALLOC)) {
6533+
ext4_msg(sb, KERN_ERR, "can't disable delalloc during remount");
6534+
err = -EINVAL;
6535+
goto restore_opts;
6536+
}
6537+
65316538
sb->s_flags = (sb->s_flags & ~SB_POSIXACL) |
65326539
(test_opt(sb, POSIX_ACL) ? SB_POSIXACL : 0);
65336540

0 commit comments

Comments
 (0)