nfs4: allow nfsv4 acls on non-regular-files
authorJ. Bruce Fields <bfields@citi.umich.edu>
Tue, 15 Jan 2008 21:43:19 +0000 (16:43 -0500)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Wed, 30 Jan 2008 07:06:10 +0000 (02:06 -0500)
The rfc doesn't give any reason it shouldn't be possible to set an
attribute on a non-regular file.  And if the server supports it, then it
shouldn't be up to us to prevent it.

Thanks to Erez for the report and Trond for further analysis.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Tested-by: Erez Zadok <ezk@cs.sunysb.edu>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
fs/nfs/nfs4proc.c

index b3d4e8e5696a4f19ea898ce580401d09512cfea2..89efbcd6fd536e5a4b6a0d1b24e98305ee88df76 100644 (file)
@@ -3617,10 +3617,6 @@ int nfs4_setxattr(struct dentry *dentry, const char *key, const void *buf,
        if (strcmp(key, XATTR_NAME_NFSV4_ACL) != 0)
                return -EOPNOTSUPP;
 
-       if (!S_ISREG(inode->i_mode) &&
-           (!S_ISDIR(inode->i_mode) || inode->i_mode & S_ISVTX))
-               return -EPERM;
-
        return nfs4_proc_set_acl(inode, buf, buflen);
 }