Skip to content

Commit ba1816b

Browse files
Sergio GelatoJiri Slaby
Sergio Gelato
authored and
Jiri Slaby
committed
nfsd: fix NFS regression
Fix regression introduced in pre-3.14 kernels by cherry-picking aa07c71 (NFSD: Call ->set_acl with a NULL ACL structure if no entries). This is in v3.12.22 as commit 723ac81. The affected code was removed in 3.14 by commit 4ac7249 (nfsd: use get_acl and ->set_acl). The ->set_acl methods are already able to cope with a NULL argument. So this is not needed for >= 3.14. Signed-off-by: Sergio Gelato <[email protected]> Signed-off-by: Jiri Slaby <[email protected]>
1 parent 0e8361a commit ba1816b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

fs/nfsd/vfs.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,9 @@ set_nfsv4_acl_one(struct dentry *dentry, struct posix_acl *pacl, char *key)
509509
char *buf = NULL;
510510
int error = 0;
511511

512+
if (!pacl)
513+
return vfs_setxattr(dentry, key, NULL, 0, 0);
514+
512515
buflen = posix_acl_xattr_size(pacl->a_count);
513516
buf = kmalloc(buflen, GFP_KERNEL);
514517
error = -ENOMEM;

0 commit comments

Comments
 (0)