Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp383473rwd; Tue, 16 May 2023 02:21:04 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7IC/8uCuF5g2OvwtHWSFuXkh1LKdvEqgnAWBalazIKxcoaZ/9Ej7wHlYOsqSZSmQB+ZyKP X-Received: by 2002:a05:6a20:918b:b0:101:4348:3e44 with SMTP id v11-20020a056a20918b00b0010143483e44mr33286483pzd.12.1684228863993; Tue, 16 May 2023 02:21:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684228863; cv=none; d=google.com; s=arc-20160816; b=wBO09/4Xxd0bY79xbCVcHwlSV7QF4qUzxspTX/Qx3s4tKfFgIF3X7IJOdOrUbK15Ak bFWfZGfV2DWthV3uQo/SholxpwcSJhIDYrBSsjrKjaYj0FUhlqjkuXBDTzZlQiqEWulT Ahs6XxVj0FMiTipan+ww6nJXfdMhIWzla9wHKsA9Yd9+d44++bSK/is0527Nm6AC3cYY 7SYZLWhtJFYlaZLXgteTmjvB2fqeClFxhFhGWbKMr6ZvG62lUNzPfm/zX8bZC0WnEYFQ Lvf1eH4bhiNBqYKmw2/WQDJpaKJvV056Xl3syn1nixPkl1y/cvC8XshhFDUQuAd4Z7In 88Tg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=/hgVKo0/+6auqDSm0KojkqxWYHhoFz6DeGwEdPrXqEA=; b=PGpxwKFiKsjVPkGrRy1W75q/eQZO7fmuRAzPXzgwbf/YClt1oQfpZ9lwPhm43f9VBF JdkK4InSoWpLBkgLjhw5kC0ObaF6tz5dsNpm4bJBBBWuK3KVvi7VSGfpqvlUn6wZOFr5 gXFWAQJI7msrUO3Gfr4zTzNNwkQeJQW2LgHFK2q6jm9fbD/byF2QF8Y3m7LYF3JJ8hQz +8Ec5CxM8wBP+Nhqf++EWSR4WlguwheEIwO1v25/y2yOgSAxAAimOglpHjNwX2iVCk1L dKP/zjHimM89a87WnpFKClqEhNmf2wM+Jtgoxx0+sXmb1vyHqOWKLdU3GM1su9C8HlqH D9Sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Lpqw6HI4; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x4-20020a63db44000000b0050bfc85d989si18451324pgi.154.2023.05.16.02.20.42; Tue, 16 May 2023 02:21:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Lpqw6HI4; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232048AbjEPJST (ORCPT + 99 others); Tue, 16 May 2023 05:18:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53694 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232109AbjEPJSG (ORCPT ); Tue, 16 May 2023 05:18:06 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 64A535B8E; Tue, 16 May 2023 02:17:40 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 9555563696; Tue, 16 May 2023 09:17:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 021A3C433D2; Tue, 16 May 2023 09:17:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1684228645; bh=D1FIpTeDymukO1Q6Xds7qPwa9hJ34HUmc7++XnT/x40=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Lpqw6HI4joCpR2QJbAV6xXUEw0j8ww7BD9N1Ff8uLlGZbkXgBAQtHXM1L7Z0MWcZa 5e6jYywodOdYzUKM6ALr8v7AAAQyh8tCEC7mvccXP6IYHWKU8ZB1ZZu0pv6d2Mwhjq h+nL0GB+yoE6H5uuyUMU4T8r7zMM+86CPWKbk29CUkgP3Xif6fqRu9iUKuLnOAT23A annqmJ3+legV1xYX6pOJv3PvelsYOm/P7lfFtWA6pJRVxRUnzQgWxb/g9l2GSiehDl sH3kHe7hT6uHItjrogAvMZC8zWKzNx8H80H7x++RxGx6J3u86BfVQ/DQesF9p/F8Uc aRcE+ya4GbesQ== Date: Tue, 16 May 2023 11:17:19 +0200 From: Christian Brauner To: Jeff Layton Cc: Trond Myklebust , "eggert@cs.ucla.edu" , "bruno@clisp.org" , "ondrej.valousek.xm@renesas.com" , "bug-gnulib@gnu.org" , "linux-fsdevel@vger.kernel.org" , "linux-nfs@vger.kernel.org" Subject: Re: [PATCH] fix NFSv4 acl detection on F39 Message-ID: <20230516-distanz-abkommen-95e565ba928b@brauner> References: <20230501194321.57983-1-ondrej.valousek.xm@renesas.com> <17355394.lhrHg4fidi@nimes> <32edbaf1-d3b1-6057-aefc-d83df3266c20@cs.ucla.edu> <4f1519d8-bda1-1b15-4a78-a8072ba1551a@cs.ucla.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Mon, May 15, 2023 at 01:49:21PM -0400, Jeff Layton wrote: > On Mon, 2023-05-15 at 17:28 +0000, Trond Myklebust wrote: > > On Mon, 2023-05-15 at 13:11 -0400, Jeff Layton wrote: > > > On Mon, 2023-05-15 at 11:50 +0000, Ondrej Valousek wrote: > > > > Hi Paul, > > > > > > > > Ok first of all, thanks for taking initiative on this, I am unable > > > > to proceed on this on my own at the moment. > > > > I see few problems with this: > > > > > > > > 1. The calculation of the 'listbufsize' is incorrect in your patch. > > > > It will _not_work as you expected and won't limit the number of > > > > syscalls (which is why we came up with this patch, right?). Check > > > > with my original proposal, we really need to check for > > > > 'system.nfs4' xattr name presence here > > > > 2. It mistakenly detects an ACL presence on files which do not have > > > > any ACL on NFSv4 filesystem. Digging further it seems that kernel > > > > in F39 behaves differently to the previous kernels: > > > > > > > > F38: > > > > # getfattr -m . /path_to_nfs4_file > > > > # file: path_to_nfs4_file > > > > system.nfs4_acl                                    <---- only > > > > single xattr detected > > > > > > > > F39: > > > > # getfattr -m . /path_to_nfs4_file > > > > # file: path_to_nfs4_file > > > > system.nfs4_acl > > > > system.posix_acl_default > > > > /* SOMETIMES even shows this */ > > > > system.posix_acl_default > > > > > > (cc'ing Christian and relevant kernel lists) > > > > > > I assume the F39 kernel is v6.4-rc based? If so, then I think that's > > > a > > > regression. NFSv4 client inodes should _not_ report a POSIX ACL > > > attribute since the protocol doesn't support them. > > > > > > In fact, I think the rationale in the kernel commit below is wrong. > > > NFSv4 has a listxattr operation, but doesn't support POSIX ACLs. > > > > > > Christian, do we need to revert this? > > > > > > commit e499214ce3ef50c50522719e753a1ffc928c2ec1 > > > Author: Christian Brauner > > > Date:   Wed Feb 1 14:15:01 2023 +0100 > > > > > >     acl: don't depend on IOP_XATTR > > >     > > > > > > > > > No. The problem is commit f2620f166e2a ("xattr: simplify listxattr > > helpers") which helpfully inserts posix acl handlers into > > generic_listxattr(), and makes it impossible to call from > > nfs4_listxattr(). > > > > > Ahh ok. Looking at that function though, it seems like it'd only report > these for mounts that set SB_POSIXACL. Any reason that we have that > turned on with v4 mounts? You seem to just be calling generic_listxattr() in fs/nfs/nfs4proc.c and not using it as an inode operation. So imho just add a tiny helper into fs/xattr.c that takes a boolean argument and skips over POSIX ACLs that you can call in nfs4. That should be enough, no?