Skip to content

Commit f044561

Browse files
Eric Sandeenmartinetd
authored andcommitted
9p: fix cache/debug options printing in v9fs_show_options
commit 4eb3117 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. debug=%x has had the same problem since options have been displayed in c4fac91 ("9p: Implement show_options") Fix these by adding the 0x prefix to the hexadecimal value shown in /proc/mounts. Fixes: 4eb3117 ("fs/9p: Rework cache modes and add new options to Documentation") Signed-off-by: Eric Sandeen <sandeen@redhat.com> Message-ID: <54b93378-dcf1-4b04-922d-c8b4393da299@redhat.com> [Dominique: use %#x at Al Viro's suggestion, also handle debug] Tested-by: Remi Pommarel <repk@triplefau.lt> Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
1 parent 1f3e414 commit f044561

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

fs/9p/v9fs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ int v9fs_show_options(struct seq_file *m, struct dentry *root)
132132
struct v9fs_session_info *v9ses = root->d_sb->s_fs_info;
133133

134134
if (v9ses->debug)
135-
seq_printf(m, ",debug=%x", v9ses->debug);
135+
seq_printf(m, ",debug=%#x", v9ses->debug);
136136
if (!uid_eq(v9ses->dfltuid, V9FS_DEFUID))
137137
seq_printf(m, ",dfltuid=%u",
138138
from_kuid_munged(&init_user_ns, v9ses->dfltuid));
@@ -148,7 +148,7 @@ int v9fs_show_options(struct seq_file *m, struct dentry *root)
148148
if (v9ses->nodev)
149149
seq_puts(m, ",nodevmap");
150150
if (v9ses->cache)
151-
seq_printf(m, ",cache=%x", v9ses->cache);
151+
seq_printf(m, ",cache=%#x", v9ses->cache);
152152
#ifdef CONFIG_9P_FSCACHE
153153
if (v9ses->cachetag && (v9ses->cache & CACHE_FSCACHE))
154154
seq_printf(m, ",cachetag=%s", v9ses->cachetag);

0 commit comments

Comments
 (0)