From mboxrd@z Thu Jan 1 00:00:00 1970 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 52244EE7FED for ; Fri, 8 Sep 2023 12:55:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232427AbjIHMzZ (ORCPT ); Fri, 8 Sep 2023 08:55:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56114 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229536AbjIHMzY (ORCPT ); Fri, 8 Sep 2023 08:55:24 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 515B219AB; Fri, 8 Sep 2023 05:55:20 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5BA56C433C9; Fri, 8 Sep 2023 12:55:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1694177719; bh=5UrZavcjPgOqABU589fSS46E/YZyUyE7h1ODOiEr+Ak=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=L1ocHcn38rHTuaClDLwPDGl6YZjY5UQPsUk6vkAWOyjgpEQ3cjhmTeTxJH4ldrCd8 KSvlkBOVobzFPJAhtqte3lOapjyLQU6Crb1elh7++siqDg8umoGSAPEudGdoNC2KvD DUxjsaSPkUrfl4tUN46niaPa4V+bWYePEsRXT+KCFMwtqe+l9ulgt5cuR4RdF3trAT hSpC+iQ9pf3A/mplv/p8VmjK3kukxaZPtOl+6xSUuZnXTdaeGWotwQBxInPjJcha7P zjeaZRpX1pu4bcrLxOWIMclwkBYZdPB2ebkkaqDAnW+AOg/4M/fS9QPFkSf7xPs4he 6bDbY/17aIkUg== Date: Fri, 8 Sep 2023 14:55:15 +0200 From: Christian Brauner To: Jeff Layton Cc: Trond Myklebust , Anna Schumaker , Alexander Viro , linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org, Ondrej Valousek Subject: Re: [PATCH RFC] nfs4: add a get_acl stub handler Message-ID: <20230908-bandbreite-orgel-065607d1b281@brauner> References: <20230907-kdevops-v1-1-c2015c29d634@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20230907-kdevops-v1-1-c2015c29d634@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Thu, Sep 07, 2023 at 01:32:36PM -0400, Jeff Layton wrote: > In older kernels, attempting to fetch that system.posix_acl_access on > NFSv4 would return -EOPNOTSUPP, but in more recent kernels that returns > -ENODATA. > > Most filesystems that don't support POSIX ACLs leave the SB_POSIXACL > flag clear, which cues the VFS to return -EOPNOTSUPP in this situation. > We can't do that with NFSv4 since that flag also cues the VFS to avoid > applying the umask early. > > Fix this by adding a stub get_acl handler for NFSv4 that always returns > -EOPNOTSUPP. > > Reported-by: Ondrej Valousek > Signed-off-by: Jeff Layton > --- > I suspect that this problem popped in due to some VFS layer changes. I > haven't identified the patch that broke it, but I think this is probably > the least invasive way to fix it. > > Another alternative would be to return -EOPNOTSUPP on filesystems that > set SB_POSIXACL but that don't set get_acl or get_inode_acl. > > Thoughts? Yes: I hate POSIX ACLs. ;) Before the VFS rework to only rely on i_op->*acl* methods POSIX ACLs were set using sb->s_xattr handlers. So when a filesystem raised SB_POSIXACL but didn't set sb->s_xattr handlers for POSIX ACLs we would: __vfs_getxattr() -> xattr_resolve_name() // no match so return EOPNOTSUPP No we have vfs_get_acl() -> __get_acl() -> i_op->get_acl // no get_acl inode method return ENODATA So as a bugfix to backport I think you should do exactly what you do here because I'm not sure if some fs relies on ENODATA to be returned if no get_acl inode method is set. There's a lot of quirkiness everywhere. But we should look through all callers and if nothing relies on EINVAL just start returning EOPNOTSUPP if no get_acl i_op is set. Looks good to me, Acked-by: Christian Brauner