Skip to content

Commit 6b992ff

Browse files
djwongtytso
authored andcommitted
ext4: disallow changing journal_csum option during remount
ext4 does not permit changing the metadata or journal checksum feature flag while mounted. Until we decide to support that, don't allow a remount to change the journal_csum flag (right now we silently fail to change anything). Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
1 parent 98c1a75 commit 6b992ff

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

‎fs/ext4/super.c‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4845,6 +4845,14 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data)
48454845
goto restore_opts;
48464846
}
48474847

4848+
if ((old_opts.s_mount_opt & EXT4_MOUNT_JOURNAL_CHECKSUM) ^
4849+
test_opt(sb, JOURNAL_CHECKSUM)) {
4850+
ext4_msg(sb, KERN_ERR, "changing journal_checksum "
4851+
"during remount not supported");
4852+
err = -EINVAL;
4853+
goto restore_opts;
4854+
}
4855+
48484856
if (test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_JOURNAL_DATA) {
48494857
if (test_opt2(sb, EXPLICIT_DELALLOC)) {
48504858
ext4_msg(sb, KERN_ERR, "can't mount with "

0 commit comments

Comments
 (0)