summaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs3acl.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2005-06-22 17:16:27 +0000
committerTrond Myklebust <Trond.Myklebust@netapp.com>2005-06-22 16:07:26 -0400
commit458818ed76d3f495f9f32373c936456c9427f759 (patch)
treecf280ec14954d61fea2f171eaa198196fe5a1e56 /fs/nfs/nfs3acl.c
parent5c6a9f7d92291c832d47e792ed1fafa44acb066e (diff)
downloadlinux-458818ed76d3f495f9f32373c936456c9427f759.tar.gz
linux-458818ed76d3f495f9f32373c936456c9427f759.tar.bz2
linux-458818ed76d3f495f9f32373c936456c9427f759.zip
[PATCH] NFS: Fix up v3 ACL caching code
Initialize the inode cache values correctly. Clean up __nfs3_forget_cached_acls() Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs3acl.c')
-rw-r--r--fs/nfs/nfs3acl.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/fs/nfs/nfs3acl.c b/fs/nfs/nfs3acl.c
index 451112ff9aa4..ee3536fc84a3 100644
--- a/fs/nfs/nfs3acl.c
+++ b/fs/nfs/nfs3acl.c
@@ -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);
}
@@ -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) {
@@ -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);