From owner-svn-src-head@freebsd.org Fri Aug 16 05:06:55 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8E192C0159; Fri, 16 Aug 2019 05:06:55 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 468rsC32fQz3JMs; Fri, 16 Aug 2019 05:06:55 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 45A6F23E75; Fri, 16 Aug 2019 05:06:55 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x7G56tiv062142; Fri, 16 Aug 2019 05:06:55 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7G56sx5062140; Fri, 16 Aug 2019 05:06:54 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201908160506.x7G56sx5062140@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 16 Aug 2019 05:06:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351113 - in head: sys/fs/fuse tests/sys/fs/fusefs X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in head: sys/fs/fuse tests/sys/fs/fusefs X-SVN-Commit-Revision: 351113 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Aug 2019 05:06:55 -0000 Author: asomers Date: Fri Aug 16 05:06:54 2019 New Revision: 351113 URL: https://svnweb.freebsd.org/changeset/base/351113 Log: fusefs: don't send the namespace during listextattr The FUSE_LISTXATTR operation always returns the full list of a file's extended attributes, in all namespaces. There's no way to filter the list server-side. However, currently FreeBSD's fusefs driver sends a namespace string with the FUSE_LISTXATTR request. That behavior was probably copied from fuse_vnop_getextattr, which has an attribute name argument. It's been there ever since extended attribute support was added in r324620. This commit removes it. Reviewed by: cem MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D21280 Modified: head/sys/fs/fuse/fuse_vnops.c head/tests/sys/fs/fusefs/mockfs.cc Modified: head/sys/fs/fuse/fuse_vnops.c ============================================================================== --- head/sys/fs/fuse/fuse_vnops.c Fri Aug 16 04:54:38 2019 (r351112) +++ head/sys/fs/fuse/fuse_vnops.c Fri Aug 16 05:06:54 2019 (r351113) @@ -2246,9 +2246,7 @@ fuse_vnop_listextattr(struct vop_listextattr_args *ap) struct mount *mp = vnode_mount(vp); struct thread *td = ap->a_td; struct ucred *cred = ap->a_cred; - size_t len; char *prefix; - char *attr_str; char *bsd_list = NULL; char *linux_list; int bsd_list_len; @@ -2274,9 +2272,7 @@ fuse_vnop_listextattr(struct vop_listextattr_args *ap) else prefix = EXTATTR_NAMESPACE_USER_STRING; - len = strlen(prefix) + sizeof(extattr_namespace_separator) + 1; - - fdisp_init(&fdi, sizeof(*list_xattr_in) + len); + fdisp_init(&fdi, sizeof(*list_xattr_in)); fdisp_make_vp(&fdi, FUSE_LISTXATTR, vp, td, cred); /* @@ -2284,8 +2280,6 @@ fuse_vnop_listextattr(struct vop_listextattr_args *ap) */ list_xattr_in = fdi.indata; list_xattr_in->size = 0; - attr_str = (char *)fdi.indata + sizeof(*list_xattr_in); - snprintf(attr_str, len, "%s%c", prefix, extattr_namespace_separator); err = fdisp_wait_answ(&fdi); if (err != 0) { @@ -2310,8 +2304,6 @@ fuse_vnop_listextattr(struct vop_listextattr_args *ap) fdisp_refresh_vp(&fdi, FUSE_LISTXATTR, vp, td, cred); list_xattr_in = fdi.indata; list_xattr_in->size = linux_list_len + sizeof(*list_xattr_out); - attr_str = (char *)fdi.indata + sizeof(*list_xattr_in); - snprintf(attr_str, len, "%s%c", prefix, extattr_namespace_separator); err = fdisp_wait_answ(&fdi); if (err != 0) Modified: head/tests/sys/fs/fusefs/mockfs.cc ============================================================================== --- head/tests/sys/fs/fusefs/mockfs.cc Fri Aug 16 04:54:38 2019 (r351112) +++ head/tests/sys/fs/fusefs/mockfs.cc Fri Aug 16 05:06:54 2019 (r351113) @@ -554,16 +554,13 @@ void MockFS::audit_request(const mockfs_buf_in &in) { "Missing request attribute name"; break; case FUSE_GETXATTR: - ASSERT_GE(inlen, fih + sizeof(in.body.setxattr)) << + ASSERT_GE(inlen, fih + sizeof(in.body.getxattr)) << "Missing request body"; - ASSERT_GT(inlen, fih + sizeof(in.body.setxattr)) << + ASSERT_GT(inlen, fih + sizeof(in.body.getxattr)) << "Missing request attribute name"; break; case FUSE_LISTXATTR: - ASSERT_GE(inlen, fih + sizeof(in.body.listxattr)) << - "Missing request body"; - ASSERT_GT(inlen, fih + sizeof(in.body.listxattr)) << - "Missing namespace"; + ASSERT_EQ(inlen, fih + sizeof(in.body.listxattr)); break; case FUSE_REMOVEXATTR: ASSERT_GT(inlen, fih) << "Missing request attribute name";