Skip to content

Commit 1afc98a

Browse files
nicbretzjfvogel
authored andcommitted
ext4: on a remount, only log the ro or r/w state when it has changed
[ Upstream commit d7b0befd09320e3356a75cb96541c030515e7f5f ] A user complained that a message such as: EXT4-fs (nvme0n1p3): re-mounted UUID ro. Quota mode: none. implied that the file system was previously mounted read/write and was now remounted read-only, when it could have been some other mount state that had changed by the "mount -o remount" operation. Fix this by only logging "ro"or "r/w" when it has changed. https://bugzilla.kernel.org/show_bug.cgi?id=219132 Signed-off-by: Nicolas Bretz <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Theodore Ts'o <[email protected]> Signed-off-by: Sasha Levin <[email protected]> (cherry picked from commit 37ac2434aae16b4a36fec163edc2928a7acf599c) Signed-off-by: Jack Vogel <[email protected]>
1 parent b51f572 commit 1afc98a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

fs/ext4/super.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6744,6 +6744,7 @@ static int ext4_reconfigure(struct fs_context *fc)
67446744
{
67456745
struct super_block *sb = fc->root->d_sb;
67466746
int ret;
6747+
bool old_ro = sb_rdonly(sb);
67476748

67486749
fc->s_fs_info = EXT4_SB(sb);
67496750

@@ -6755,9 +6756,9 @@ static int ext4_reconfigure(struct fs_context *fc)
67556756
if (ret < 0)
67566757
return ret;
67576758

6758-
ext4_msg(sb, KERN_INFO, "re-mounted %pU %s. Quota mode: %s.",
6759-
&sb->s_uuid, sb_rdonly(sb) ? "ro" : "r/w",
6760-
ext4_quota_mode(sb));
6759+
ext4_msg(sb, KERN_INFO, "re-mounted %pU%s.",
6760+
&sb->s_uuid,
6761+
(old_ro != sb_rdonly(sb)) ? (sb_rdonly(sb) ? " ro" : " r/w") : "");
67616762

67626763
return 0;
67636764
}

0 commit comments

Comments
 (0)