Skip to content

Commit 7dd7d95

Browse files
malahaltrondmypd
authored andcommitted
nfs: handle servers that support only ALLOW ACE type.
Currently we support ACLs if the NFS server file system supports both ALLOW and DENY ACE types. This patch makes the Linux client work with ACLs even if the server supports only 'ALLOW' ACE type. Signed-off-by: Malahal Naineni <malahal@us.ibm.com> Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
1 parent ed7e542 commit 7dd7d95

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

fs/nfs/nfs4proc.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2744,7 +2744,8 @@ static int _nfs4_server_capabilities(struct nfs_server *server, struct nfs_fh *f
27442744
NFS_CAP_OWNER_GROUP|NFS_CAP_ATIME|
27452745
NFS_CAP_CTIME|NFS_CAP_MTIME|
27462746
NFS_CAP_SECURITY_LABEL);
2747-
if (res.attr_bitmask[0] & FATTR4_WORD0_ACL)
2747+
if (res.attr_bitmask[0] & FATTR4_WORD0_ACL &&
2748+
res.acl_bitmask & ACL4_SUPPORT_ALLOW_ACL)
27482749
server->caps |= NFS_CAP_ACLS;
27492750
if (res.has_links != 0)
27502751
server->caps |= NFS_CAP_HARDLINKS;
@@ -4321,9 +4322,7 @@ static int nfs4_proc_renew(struct nfs_client *clp, struct rpc_cred *cred)
43214322

43224323
static inline int nfs4_server_supports_acls(struct nfs_server *server)
43234324
{
4324-
return (server->caps & NFS_CAP_ACLS)
4325-
&& (server->acl_bitmask & ACL4_SUPPORT_ALLOW_ACL)
4326-
&& (server->acl_bitmask & ACL4_SUPPORT_DENY_ACL);
4325+
return server->caps & NFS_CAP_ACLS;
43274326
}
43284327

43294328
/* Assuming that XATTR_SIZE_MAX is a multiple of PAGE_SIZE, and that

0 commit comments

Comments
 (0)