[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <54b93378-dcf1-4b04-922d-c8b4393da299@redhat.com>
Date: Tue, 2 Dec 2025 16:30:53 -0600
From: Eric Sandeen <sandeen@...hat.com>
To: v9fs@...ts.linux.dev
Cc: 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: [PATCH V3 5/4] 9p: fix cache option printing in v9fs_show_options
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);
#ifdef CONFIG_9P_FSCACHE
if (v9ses->cachetag && (v9ses->cache & CACHE_FSCACHE))
seq_printf(m, ",cachetag=%s", v9ses->cachetag);
Powered by blists - more mailing lists