Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 2786
b: refs/heads/master
c: 458818e
h: refs/heads/master
v: v3
  • Loading branch information
Trond Myklebust authored and Trond Myklebust committed Jun 22, 2005
1 parent 6c3434f commit acf54dd
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5c6a9f7d92291c832d47e792ed1fafa44acb066e
refs/heads/master: 458818ed76d3f495f9f32373c936456c9427f759
4 changes: 4 additions & 0 deletions trunk/fs/nfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1961,6 +1961,10 @@ static struct inode *nfs_alloc_inode(struct super_block *sb)
if (!nfsi)
return NULL;
nfsi->flags = 0;
#ifdef CONFIG_NFS_V3_ACL
nfsi->acl_access = ERR_PTR(-EAGAIN);
nfsi->acl_default = ERR_PTR(-EAGAIN);
#endif
#ifdef CONFIG_NFS_V4
nfsi->nfs4_acl = NULL;
#endif /* CONFIG_NFS_V4 */
Expand Down
11 changes: 6 additions & 5 deletions trunk/fs/nfs/nfs3acl.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,11 @@ int nfs3_removexattr(struct dentry *dentry, const char *name)

static void __nfs3_forget_cached_acls(struct nfs_inode *nfsi)
{
if (nfsi->acl_access != ERR_PTR(-EAGAIN)) {
if (!IS_ERR(nfsi->acl_access)) {
posix_acl_release(nfsi->acl_access);
nfsi->acl_access = ERR_PTR(-EAGAIN);
}
if (nfsi->acl_default != ERR_PTR(-EAGAIN)) {
if (!IS_ERR(nfsi->acl_default)) {
posix_acl_release(nfsi->acl_default);
nfsi->acl_default = ERR_PTR(-EAGAIN);
}
Expand All @@ -137,7 +137,7 @@ void nfs3_forget_cached_acls(struct inode *inode)
static struct posix_acl *nfs3_get_cached_acl(struct inode *inode, int type)
{
struct nfs_inode *nfsi = NFS_I(inode);
struct posix_acl *acl = ERR_PTR(-EAGAIN);
struct posix_acl *acl = ERR_PTR(-EINVAL);

spin_lock(&inode->i_lock);
switch(type) {
Expand All @@ -150,12 +150,13 @@ static struct posix_acl *nfs3_get_cached_acl(struct inode *inode, int type)
break;

default:
return ERR_PTR(-EINVAL);
goto out;
}
if (acl == ERR_PTR(-EAGAIN))
if (IS_ERR(acl))
acl = ERR_PTR(-EAGAIN);
else
acl = posix_acl_dup(acl);
out:
spin_unlock(&inode->i_lock);
dprintk("NFS: nfs3_get_cached_acl(%s/%ld, %d) = %p\n", inode->i_sb->s_id,
inode->i_ino, type, acl);
Expand Down

0 comments on commit acf54dd

Please sign in to comment.