[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c1d0a33e-768a-45ee-b870-e84c25b04896@redhat.com>
Date: Tue, 2 Dec 2025 19:09:42 -0600
From: Eric Sandeen <sandeen@...hat.com>
To: Al Viro <viro@...iv.linux.org.uk>
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 12/2/25 5:13 PM, Al Viro wrote:
> 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"?
>
Nothing, presumably - I did not know this existed TBH.
(looks like that usage is about 1/10 of 0x%x currently)
-Eric
Powered by blists - more mailing lists