Commit 377b71e1 authored by NeilBrown's avatar NeilBrown Committed by Jiri Slaby

nfsd: fix problem with setting ACL on directories

This is a regression of 3.12 stable commit
ba1816b4 (nfsd: fix NFS regression).

If a non-inherited ACL is set on a directory, nfsd will try to set the Posix
default ACL to NULL.  This gets converted to "" by generic_setxattr().
As "" is not a valid posix acl attribute value, this results in an error.

So instead of setting the xattr to NULL, remove it.

Fixes: ba1816b4 ("nfsd: fix NFS regression")
Signed-off-by: default avatarNeilBrown <neilb@suse.com>
Cc: Sergio Gelato <Sergio.Gelato@astro.su.se>
Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
parent e890f13e
...@@ -510,7 +510,7 @@ set_nfsv4_acl_one(struct dentry *dentry, struct posix_acl *pacl, char *key) ...@@ -510,7 +510,7 @@ set_nfsv4_acl_one(struct dentry *dentry, struct posix_acl *pacl, char *key)
int error = 0; int error = 0;
if (!pacl) if (!pacl)
return vfs_setxattr(dentry, key, NULL, 0, 0); return vfs_removexattr(dentry, key);
buflen = posix_acl_xattr_size(pacl->a_count); buflen = posix_acl_xattr_size(pacl->a_count);
buf = kmalloc(buflen, GFP_KERNEL); buf = kmalloc(buflen, GFP_KERNEL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment