]> git.baikalelectronics.ru Git - kernel.git/commit
ext4: fix incorrect options show of original mount_opt and extend mount_opt2
authorZhang Yi <yi.zhang@huawei.com>
Sun, 29 Jan 2023 03:49:39 +0000 (11:49 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 11 Mar 2023 12:55:27 +0000 (13:55 +0100)
commit425542af77b8e0015e4be49a8c4d6c962d3038f7
tree45f986861c5822723f587aef7d6851b55059b2d7
parentede076ae7af87b38d5a3cbdab10d3d2c1bbbfa25
ext4: fix incorrect options show of original mount_opt and extend mount_opt2

[ Upstream commit bb1245fde830174f5ddd705c52ec012ef80bb40b ]

Current _ext4_show_options() do not distinguish MOPT_2 flag, so it mixed
extend sbi->s_mount_opt2 options with sbi->s_mount_opt, it could lead to
show incorrect options, e.g. show fc_debug_force if we mount with
errors=continue mode and miss it if we set.

  $ mkfs.ext4 /dev/pmem0
  $ mount -o errors=remount-ro /dev/pmem0 /mnt
  $ cat /proc/fs/ext4/pmem0/options | grep fc_debug_force
    #empty
  $ mount -o remount,errors=continue /mnt
  $ cat /proc/fs/ext4/pmem0/options | grep fc_debug_force
    fc_debug_force
  $ mount -o remount,errors=remount-ro,fc_debug_force /mnt
  $ cat /proc/fs/ext4/pmem0/options | grep fc_debug_force
    #empty

Fixes: 406f14bf7b69 ("ext4: add fast_commit feature and handling for extended mount options")
Signed-off-by: Zhang Yi <yi.zhang@huawei.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20230129034939.3702550-1-yi.zhang@huaweicloud.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/ext4/ext4.h
fs/ext4/super.c