Skip to content

Commit 8142db4

Browse files
committed
fs/9p: allow disable of xattr support on mount
xattr creates a lot of additional messages for 9p in the current implementation. This allows users to conditionalize xattr support on 9p mount if they are on a connection with bad latency. Using this flag is also useful when debugging other aspects of 9p as it reduces the noise in the trace files. Signed-off-by: Eric Van Hensbergen <ericvh@kernel.org> Reviewed-by: Dominique Martinet <asmadeus@codewreck.org>
1 parent 740b8bf commit 8142db4

4 files changed

Lines changed: 14 additions & 3 deletions

File tree

Documentation/filesystems/9p.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,8 @@ Options
137137
This can be used to share devices/named pipes/sockets between
138138
hosts. This functionality will be expanded in later versions.
139139

140+
noxattr do not offer xattr functions on this mount.
141+
140142
access there are four access modes.
141143
user
142144
if a user tries to access a file on v9fs

fs/9p/v9fs.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ enum {
3838
/* String options */
3939
Opt_uname, Opt_remotename, Opt_cache, Opt_cachetag,
4040
/* Options that take no arguments */
41-
Opt_nodevmap,
41+
Opt_nodevmap, Opt_noxattr,
4242
/* Access options */
4343
Opt_access, Opt_posixacl,
4444
/* Lock timeout option */
@@ -55,6 +55,7 @@ static const match_table_t tokens = {
5555
{Opt_uname, "uname=%s"},
5656
{Opt_remotename, "aname=%s"},
5757
{Opt_nodevmap, "nodevmap"},
58+
{Opt_noxattr, "noxattr"},
5859
{Opt_cache, "cache=%s"},
5960
{Opt_cachetag, "cachetag=%s"},
6061
{Opt_access, "access=%s"},
@@ -149,6 +150,9 @@ int v9fs_show_options(struct seq_file *m, struct dentry *root)
149150
if (v9ses->flags & V9FS_POSIX_ACL)
150151
seq_puts(m, ",posixacl");
151152

153+
if (v9ses->flags & V9FS_NO_XATTR)
154+
seq_puts(m, ",noxattr");
155+
152156
return p9_show_client_options(m, v9ses->clnt);
153157
}
154158

@@ -269,6 +273,9 @@ static int v9fs_parse_options(struct v9fs_session_info *v9ses, char *opts)
269273
case Opt_nodevmap:
270274
v9ses->nodev = 1;
271275
break;
276+
case Opt_noxattr:
277+
v9ses->flags |= V9FS_NO_XATTR;
278+
break;
272279
case Opt_cachetag:
273280
#ifdef CONFIG_9P_FSCACHE
274281
kfree(v9ses->cachetag);

fs/9p/v9fs.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ enum p9_session_flags {
3636
V9FS_ACCESS_SINGLE = 0x04,
3737
V9FS_ACCESS_USER = 0x08,
3838
V9FS_ACCESS_CLIENT = 0x10,
39-
V9FS_POSIX_ACL = 0x20
39+
V9FS_POSIX_ACL = 0x20,
40+
V9FS_NO_XATTR = 0x40
4041
};
4142

4243
/* possible values of ->cache */

fs/9p/vfs_super.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ v9fs_fill_super(struct super_block *sb, struct v9fs_session_info *v9ses,
6464
sb->s_magic = V9FS_MAGIC;
6565
if (v9fs_proto_dotl(v9ses)) {
6666
sb->s_op = &v9fs_super_ops_dotl;
67-
sb->s_xattr = v9fs_xattr_handlers;
67+
if (!(v9ses->flags & V9FS_NO_XATTR))
68+
sb->s_xattr = v9fs_xattr_handlers;
6869
} else {
6970
sb->s_op = &v9fs_super_ops;
7071
sb->s_time_max = U32_MAX;

0 commit comments

Comments
 (0)