ext4: bad mount opts in no journal mode
diff mbox series

Message ID 20190411214917.1899-1-dbanerje@akamai.com
State New
Headers show
Series
  • ext4: bad mount opts in no journal mode
Related show

Commit Message

Debabrata Banerjee April 11, 2019, 9:49 p.m. UTC
Fixes:
commit 1e381f60dad9 ("ext4: do not allow journal_opts for fs w/o journal")

Instead of removing EXT4_MOUNT_JOURNAL_CHECKSUM from s_def_mount_opt as
I assume was intended, all other options were blown away leading to
_ext4_show_options() output being incorrect. I don't see why this or
other journal related flags should be removed from s_def_mount_opt
regardless, it is only used for comparison to display opts, and we
already made sure they couldn't be set.

Signed-off-by: Debabrata Banerjee <dbanerje@akamai.com>
---
 fs/ext4/super.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Debabrata Banerjee April 23, 2019, 2:33 p.m. UTC | #1
ping?

´╗┐On 4/11/19, 5:49 PM, "Debabrata Banerjee" <dbanerje@akamai.com> wrote:

    Fixes:
    commit 1e381f60dad9 ("ext4: do not allow journal_opts for fs w/o journal")
    
    Instead of removing EXT4_MOUNT_JOURNAL_CHECKSUM from s_def_mount_opt as
    I assume was intended, all other options were blown away leading to
    _ext4_show_options() output being incorrect. I don't see why this or
    other journal related flags should be removed from s_def_mount_opt
    regardless, it is only used for comparison to display opts, and we
    already made sure they couldn't be set.
    
    Signed-off-by: Debabrata Banerjee <dbanerje@akamai.com>
    ---
     fs/ext4/super.c | 1 -
     1 file changed, 1 deletion(-)
    
    diff --git a/fs/ext4/super.c b/fs/ext4/super.c
    index 6ed4eb81e674..63eef29666e0 100644
    --- a/fs/ext4/super.c
    +++ b/fs/ext4/super.c
    @@ -4238,7 +4238,6 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
     				 "data=, fs mounted w/o journal");
     			goto failed_mount_wq;
     		}
    -		sbi->s_def_mount_opt &= EXT4_MOUNT_JOURNAL_CHECKSUM;
     		clear_opt(sb, JOURNAL_CHECKSUM);
     		clear_opt(sb, DATA_FLAGS);
     		sbi->s_journal = NULL;
    -- 
    2.21.0
Jan Kara April 28, 2019, 8:21 p.m. UTC | #2
On Thu 11-04-19 17:49:17, Debabrata Banerjee wrote:
> Fixes:
> commit 1e381f60dad9 ("ext4: do not allow journal_opts for fs w/o journal")
> 
> Instead of removing EXT4_MOUNT_JOURNAL_CHECKSUM from s_def_mount_opt as
> I assume was intended, all other options were blown away leading to
> _ext4_show_options() output being incorrect. I don't see why this or
> other journal related flags should be removed from s_def_mount_opt
> regardless, it is only used for comparison to display opts, and we
> already made sure they couldn't be set.
> 
> Signed-off-by: Debabrata Banerjee <dbanerje@akamai.com>

So I agree that the clearing is wrong. But I don't agree with just deleting
the line. We could have JOURNAL_CHECKSUM in s_def_mount_opt in nojournal
mode and in such case we don't want to show in /proc/mounts
nojournal_checksum as a mount option. So the line should be really fixed
to:

	sbi->s_def_mount_opt &= ~EXT4_MOUNT_JOURNAL_CHECKSUM;

								Honza

> ---
>  fs/ext4/super.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/fs/ext4/super.c b/fs/ext4/super.c
> index 6ed4eb81e674..63eef29666e0 100644
> --- a/fs/ext4/super.c
> +++ b/fs/ext4/super.c
> @@ -4238,7 +4238,6 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
>  				 "data=, fs mounted w/o journal");
>  			goto failed_mount_wq;
>  		}
> -		sbi->s_def_mount_opt &= EXT4_MOUNT_JOURNAL_CHECKSUM;
>  		clear_opt(sb, JOURNAL_CHECKSUM);
>  		clear_opt(sb, DATA_FLAGS);
>  		sbi->s_journal = NULL;
> -- 
> 2.21.0
>

Patch
diff mbox series

diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 6ed4eb81e674..63eef29666e0 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -4238,7 +4238,6 @@  static int ext4_fill_super(struct super_block *sb, void *data, int silent)
 				 "data=, fs mounted w/o journal");
 			goto failed_mount_wq;
 		}
-		sbi->s_def_mount_opt &= EXT4_MOUNT_JOURNAL_CHECKSUM;
 		clear_opt(sb, JOURNAL_CHECKSUM);
 		clear_opt(sb, DATA_FLAGS);
 		sbi->s_journal = NULL;