]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blame - src/patches/suse-2.6.27.25/patches.fixes/nfs-acl-caching.diff
Reenabled linux-xen and xen-image build
[people/pmueller/ipfire-2.x.git] / src / patches / suse-2.6.27.25 / patches.fixes / nfs-acl-caching.diff
CommitLineData
8f69975d
BS
1From: Andreas Gruenbacher <agruen@suse.de>
2Subject: "No acl" entry put in client-side acl cache instead of "not cached"
3References: 171059
4
5When the acl of a file is not cached and only the default acl of that
6file is requested, a NULL "no acl" entry is put in the client-side acl
7cache of nfs instead of ERR_PTR(-EAGAIN) "not cached".
8
9Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
10
11Index: linux-2.6.16/fs/nfs/nfs3acl.c
12===================================================================
13--- linux-2.6.16.orig/fs/nfs/nfs3acl.c
14+++ linux-2.6.16/fs/nfs/nfs3acl.c
15@@ -172,8 +172,10 @@ static void nfs3_cache_acls(struct inode
16 inode->i_ino, acl, dfacl);
17 spin_lock(&inode->i_lock);
18 __nfs3_forget_cached_acls(NFS_I(inode));
19- nfsi->acl_access = posix_acl_dup(acl);
20- nfsi->acl_default = posix_acl_dup(dfacl);
21+ if (!IS_ERR(acl))
22+ nfsi->acl_access = posix_acl_dup(acl);
23+ if (!IS_ERR(dfacl))
24+ nfsi->acl_default = posix_acl_dup(dfacl);
25 spin_unlock(&inode->i_lock);
26 }
27
28@@ -250,7 +252,9 @@ struct posix_acl *nfs3_proc_getacl(struc
29 res.acl_access = NULL;
30 }
31 }
32- nfs3_cache_acls(inode, res.acl_access, res.acl_default);
33+ nfs3_cache_acls(inode,
34+ (res.mask & NFS_ACL) ? res.acl_access : ERR_PTR(-EINVAL),
35+ (res.mask & NFS_DFACL) ? res.acl_default : ERR_PTR(-EINVAL));
36
37 switch(type) {
38 case ACL_TYPE_ACCESS:
39@@ -321,6 +325,7 @@ static int nfs3_proc_setacls(struct inod
40 switch (status) {
41 case 0:
42 status = nfs_refresh_inode(inode, &fattr);
43+ nfs3_cache_acls(inode, acl, dfacl);
44 break;
45 case -EPFNOSUPPORT:
46 case -EPROTONOSUPPORT: