All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nfs: we don't support removing system.nfs4_acl
@ 2021-01-28 22:36 J. Bruce Fields
       [not found] ` <95e5f9e4-76d4-08c4-ece3-35a10c06073b@vastdata.com>
  0 siblings, 1 reply; 12+ messages in thread
From: J. Bruce Fields @ 2021-01-28 22:36 UTC (permalink / raw)
  To: Anna Schumaker, Trond Myklebust; +Cc: linux-nfs

From: "J. Bruce Fields" <bfields@redhat.com>

The NFSv4 protocol doesn't have any notion of reomoving an attribute, so
removexattr(path,"system.nfs4_acl") doesn't make sense.

There's no documented return value.  Arguably it could be EOPNOTSUPP but
I'm a little worried an application might take that to mean that we
don't support ACLs or xattrs.  How about EINVAL?

Signed-off-by: J. Bruce Fields <bfields@redhat.com>
---
 fs/nfs/nfs4proc.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 2f4679a62712..d50dea5f5723 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -5895,6 +5895,9 @@ static int __nfs4_proc_set_acl(struct inode *inode, const void *buf, size_t bufl
 	unsigned int npages = DIV_ROUND_UP(buflen, PAGE_SIZE);
 	int ret, i;
 
+	/* You can't remove system.nfs4_acl: */
+	if (buflen == 0)
+		return -EINVAL;
 	if (!nfs4_server_supports_acls(server))
 		return -EOPNOTSUPP;
 	if (npages > ARRAY_SIZE(pages))
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2021-03-12 15:44 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-28 22:36 [PATCH] nfs: we don't support removing system.nfs4_acl J. Bruce Fields
     [not found] ` <95e5f9e4-76d4-08c4-ece3-35a10c06073b@vastdata.com>
2021-01-29  1:37   ` Trond Myklebust
2021-01-29  2:35     ` bfields
2021-01-29  2:50       ` bfields
2021-01-31 20:41         ` Trond Myklebust
2021-01-31 21:58           ` bfields
2021-02-03 20:07             ` bfields
2021-02-08 19:31               ` Trond Myklebust
2021-02-08 22:08                 ` bfields
2021-02-11 18:54                   ` bfields
2021-03-04  2:30                     ` Murphy Zhou
2021-03-12 15:43                       ` Anna Schumaker

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.