diff options
Diffstat (limited to 'fs/nfs')
-rw-r--r-- | fs/nfs/nfs3acl.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/fs/nfs/nfs3acl.c b/fs/nfs/nfs3acl.c index 33287879bd23..7322da4d2055 100644 --- a/fs/nfs/nfs3acl.c +++ b/fs/nfs/nfs3acl.c | |||
@@ -172,8 +172,10 @@ static void nfs3_cache_acls(struct inode *inode, struct posix_acl *acl, | |||
172 | inode->i_ino, acl, dfacl); | 172 | inode->i_ino, acl, dfacl); |
173 | spin_lock(&inode->i_lock); | 173 | spin_lock(&inode->i_lock); |
174 | __nfs3_forget_cached_acls(NFS_I(inode)); | 174 | __nfs3_forget_cached_acls(NFS_I(inode)); |
175 | nfsi->acl_access = posix_acl_dup(acl); | 175 | if (!IS_ERR(acl)) |
176 | nfsi->acl_default = posix_acl_dup(dfacl); | 176 | nfsi->acl_access = posix_acl_dup(acl); |
177 | if (!IS_ERR(dfacl)) | ||
178 | nfsi->acl_default = posix_acl_dup(dfacl); | ||
177 | spin_unlock(&inode->i_lock); | 179 | spin_unlock(&inode->i_lock); |
178 | } | 180 | } |
179 | 181 | ||
@@ -254,7 +256,9 @@ struct posix_acl *nfs3_proc_getacl(struct inode *inode, int type) | |||
254 | res.acl_access = NULL; | 256 | res.acl_access = NULL; |
255 | } | 257 | } |
256 | } | 258 | } |
257 | nfs3_cache_acls(inode, res.acl_access, res.acl_default); | 259 | nfs3_cache_acls(inode, |
260 | (res.mask & NFS_ACL) ? res.acl_access : ERR_PTR(-EINVAL), | ||
261 | (res.mask & NFS_DFACL) ? res.acl_default : ERR_PTR(-EINVAL)); | ||
258 | 262 | ||
259 | switch(type) { | 263 | switch(type) { |
260 | case ACL_TYPE_ACCESS: | 264 | case ACL_TYPE_ACCESS: |
@@ -329,6 +333,7 @@ static int nfs3_proc_setacls(struct inode *inode, struct posix_acl *acl, | |||
329 | switch (status) { | 333 | switch (status) { |
330 | case 0: | 334 | case 0: |
331 | status = nfs_refresh_inode(inode, &fattr); | 335 | status = nfs_refresh_inode(inode, &fattr); |
336 | nfs3_cache_acls(inode, acl, dfacl); | ||
332 | break; | 337 | break; |
333 | case -EPFNOSUPPORT: | 338 | case -EPFNOSUPPORT: |
334 | case -EPROTONOSUPPORT: | 339 | case -EPROTONOSUPPORT: |