From nobody Wed Sep 17 15:48:01 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 31166C4332F for ; Sun, 18 Dec 2022 23:24:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231194AbiLRXYL (ORCPT ); Sun, 18 Dec 2022 18:24:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51266 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231193AbiLRXXx (ORCPT ); Sun, 18 Dec 2022 18:23:53 -0500 Received: from ms11p00im-qufo17281301.me.com (ms11p00im-qufo17281301.me.com [17.58.38.50]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 45439BE08 for ; Sun, 18 Dec 2022 15:23:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=icloud.com; s=1a1hai; t=1671405822; bh=LTQeSnHB9tsXZcputSEm3mn8KgKyBhPbKH6Ub3wWTBY=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=gwyLEZPZR4SZt0tBotTT6SrR1b3XiW+pb3OCjvtP8UY25PsZVgNM1zx7fkR3CC9G+ 61tkvo0PNEoHyQNUktMw0B4tv6twq2CNDu0A0mjE6G2YmsXD698yzVOrZ5tHMwscMU op7vnh9O3+m9Rnq1wyVk4a3ebXhVmBCWgc4j5ExlOZe2uqIt9ydx8nL4CTwpCP5jEI 2CGmE8kmmk8fwaEZFVq+EhXbpzDkAyLNXG9ZoWnX12/uIAuQwA1U/giM/q9j6gI99D ZvGGozsjIRoyL/cpTDv0Pr/RVI5bQ/Senf/Wqwom7R6Sk35AV3S6/EI9cHsM3CQ7rI TMcfTglqFgs+g== Received: from thundercleese.localdomain (ms11p00im-dlb-asmtpmailmevip.me.com [17.57.154.19]) by ms11p00im-qufo17281301.me.com (Postfix) with ESMTPSA id 1E3D1CC041B; Sun, 18 Dec 2022 23:23:41 +0000 (UTC) From: Eric Van Hensbergen To: v9fs-developer@lists.sourceforge.net, asmadeus@codewreck.org, rminnich@gmail.com, lucho@ionkov.net Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux_oss@crudebyte.com, Eric Van Hensbergen Subject: [PATCH v2 05/10] allow disable of xattr support on mount Date: Sun, 18 Dec 2022 23:22:17 +0000 Message-Id: <20221218232217.1713283-6-evanhensbergen@icloud.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20221218232217.1713283-1-evanhensbergen@icloud.com> References: <20221217183142.1425132-1-evanhensbergen@icloud.com> <20221218232217.1713283-1-evanhensbergen@icloud.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-ORIG-GUID: SWVjh7ha5_I54cqlvRaU2BHa_lZcinxc X-Proofpoint-GUID: SWVjh7ha5_I54cqlvRaU2BHa_lZcinxc X-Proofpoint-Virus-Version: =?UTF-8?Q?vendor=3Dfsecure_engine=3D1.1.170-22c6f66c430a71ce266a39bfe25bc?= =?UTF-8?Q?2903e8d5c8f:6.0.425,18.0.572,17.11.62.513.0000000_definitions?= =?UTF-8?Q?=3D2022-01-14=5F01:2022-01-14=5F01,2020-02-14=5F11,2021-12-02?= =?UTF-8?Q?=5F01_signatures=3D0?= X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 clxscore=1015 mlxscore=0 spamscore=0 adultscore=0 bulkscore=0 malwarescore=0 mlxlogscore=917 phishscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2212180222 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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 --- Documentation/filesystems/9p.rst | 2 ++ fs/9p/v9fs.c | 9 ++++++++- fs/9p/v9fs.h | 3 ++- fs/9p/vfs_super.c | 3 ++- 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/Documentation/filesystems/9p.rst b/Documentation/filesystems/9= p.rst index 7b5964bc8865..0e800b8f73cc 100644 --- a/Documentation/filesystems/9p.rst +++ b/Documentation/filesystems/9p.rst @@ -137,6 +137,8 @@ Options This can be used to share devices/named pipes/sockets between hosts. This functionality will be expanded in later versions. =20 + noxattr do not offer xattr functions on this mount. + access there are four access modes. user if a user tries to access a file on v9fs diff --git a/fs/9p/v9fs.c b/fs/9p/v9fs.c index a46bf9121f11..f8e952c013f9 100644 --- a/fs/9p/v9fs.c +++ b/fs/9p/v9fs.c @@ -38,7 +38,7 @@ enum { /* String options */ Opt_uname, Opt_remotename, Opt_cache, Opt_cachetag, /* Options that take no arguments */ - Opt_nodevmap, + Opt_nodevmap, Opt_noxattr, /* Access options */ Opt_access, Opt_posixacl, /* Lock timeout option */ @@ -55,6 +55,7 @@ static const match_table_t tokens =3D { {Opt_uname, "uname=3D%s"}, {Opt_remotename, "aname=3D%s"}, {Opt_nodevmap, "nodevmap"}, + {Opt_noxattr, "noxattr"}, {Opt_cache, "cache=3D%s"}, {Opt_cachetag, "cachetag=3D%s"}, {Opt_access, "access=3D%s"}, @@ -149,6 +150,9 @@ int v9fs_show_options(struct seq_file *m, struct dentry= *root) if (v9ses->flags & V9FS_POSIX_ACL) seq_puts(m, ",posixacl"); =20 + if (v9ses->flags & V9FS_NO_XATTR) + seq_puts(m, ",noxattr"); + return p9_show_client_options(m, v9ses->clnt); } =20 @@ -269,6 +273,9 @@ static int v9fs_parse_options(struct v9fs_session_info = *v9ses, char *opts) case Opt_nodevmap: v9ses->nodev =3D 1; break; + case Opt_noxattr: + v9ses->flags |=3D V9FS_NO_XATTR; + break; case Opt_cachetag: #ifdef CONFIG_9P_FSCACHE kfree(v9ses->cachetag); diff --git a/fs/9p/v9fs.h b/fs/9p/v9fs.h index 5813967ecdf0..a08cf6618c86 100644 --- a/fs/9p/v9fs.h +++ b/fs/9p/v9fs.h @@ -36,7 +36,8 @@ enum p9_session_flags { V9FS_ACCESS_SINGLE =3D 0x04, V9FS_ACCESS_USER =3D 0x08, V9FS_ACCESS_CLIENT =3D 0x10, - V9FS_POSIX_ACL =3D 0x20 + V9FS_POSIX_ACL =3D 0x20, + V9FS_NO_XATTR =3D 0x40 }; =20 /* possible values of ->cache */ diff --git a/fs/9p/vfs_super.c b/fs/9p/vfs_super.c index 65d96fa94ba2..5fc6a945bfff 100644 --- a/fs/9p/vfs_super.c +++ b/fs/9p/vfs_super.c @@ -64,7 +64,8 @@ v9fs_fill_super(struct super_block *sb, struct v9fs_sessi= on_info *v9ses, sb->s_magic =3D V9FS_MAGIC; if (v9fs_proto_dotl(v9ses)) { sb->s_op =3D &v9fs_super_ops_dotl; - sb->s_xattr =3D v9fs_xattr_handlers; + if (!(v9ses->flags & V9FS_NO_XATTR)) + sb->s_xattr =3D v9fs_xattr_handlers; } else { sb->s_op =3D &v9fs_super_ops; sb->s_time_max =3D U32_MAX; --=20 2.37.2