edit commit description
[ext4-patch-queue.git] / disallow-changing-journal-csum-option-during-remount
blob60c9ed0a1a7aa5e20a82382b1babe433a808463d
1 ext4: disallow changing journal_csum option during remount
3 From: "Darrick J. Wong" <darrick.wong@oracle.com>
5 ext4 does not permit changing the metadata or journal checksum feature
6 flag while mounted.  Until we decide to support that, don't allow a
7 remount to change the journal_csum flag (right now we silently fail to
8 change anything).
10 Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
11 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
12 ---
13  fs/ext4/super.c |    8 ++++++++
14  1 file changed, 8 insertions(+)
17 diff --git a/fs/ext4/super.c b/fs/ext4/super.c
18 index 5c11e21..96059e0 100644
19 --- a/fs/ext4/super.c
20 +++ b/fs/ext4/super.c
21 @@ -4845,6 +4845,14 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data)
22                 goto restore_opts;
23         }
25 +       if ((old_opts.s_mount_opt & EXT4_MOUNT_JOURNAL_CHECKSUM) ^
26 +           test_opt(sb, JOURNAL_CHECKSUM)) {
27 +               ext4_msg(sb, KERN_ERR, "changing journal_checksum "
28 +                        "during remount not supported");
29 +               err = -EINVAL;
30 +               goto restore_opts;
31 +       }
33         if (test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_JOURNAL_DATA) {
34                 if (test_opt2(sb, EXPLICIT_DELALLOC)) {
35                         ext4_msg(sb, KERN_ERR, "can't mount with "