[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251202231352.GF1712166@ZenIV>
Date: Tue, 2 Dec 2025 23:13:52 +0000
From: Al Viro <viro@...iv.linux.org.uk>
To: Eric Sandeen <sandeen@...hat.com>
Cc: v9fs@...ts.linux.dev, linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org, ericvh@...nel.org, lucho@...kov.net,
asmadeus@...ewreck.org, linux_oss@...debyte.com, eadavis@...com,
Remi Pommarel <repk@...plefau.lt>
Subject: Re: [PATCH V3 5/4] 9p: fix cache option printing in v9fs_show_options
On Tue, Dec 02, 2025 at 04:30:53PM -0600, Eric Sandeen wrote:
> commit 4eb3117888a92 changed the cache= option to accept either string
> shortcuts or bitfield values. It also changed /proc/mounts to emit the
> option as the hexadecimal numeric value rather than the shortcut string.
>
> However, by printing "cache=%x" without the leading 0x, shortcuts such
> as "cache=loose" will emit "cache=f" and 'f' is not a string that is
> parseable by kstrtoint(), so remounting may fail if a remount with
> "cache=f" is attempted.
>
> Fix this by adding the 0x prefix to the hexadecimal value shown in
> /proc/mounts.
>
> Fixes: 4eb3117888a92 ("fs/9p: Rework cache modes and add new options to Documentation")
> Signed-off-by: Eric Sandeen <sandeen@...hat.com>
> ---
>
> diff --git a/fs/9p/v9fs.c b/fs/9p/v9fs.c
> index 05fc2ba3c5d4..d684cb406ed6 100644
> --- a/fs/9p/v9fs.c
> +++ b/fs/9p/v9fs.c
> @@ -148,7 +148,7 @@ int v9fs_show_options(struct seq_file *m, struct dentry *root)
> if (v9ses->nodev)
> seq_puts(m, ",nodevmap");
> if (v9ses->cache)
> - seq_printf(m, ",cache=%x", v9ses->cache);
> + seq_printf(m, ",cache=0x%x", v9ses->cache);
What's wrong with "cache=%#x"?
Powered by blists - more mailing lists