aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2009-03-10 20:33:18 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2009-03-10 20:33:18 -0400
commitae46141ff08f1965b17c531b571953c39ce8b9e2 (patch)
tree12e9b19461fb00c7ba21d93272ddd470ca0e82b0 /include/linux
parentef95d31e6de6be9602ce950b85fb7ab8af46ae42 (diff)
NFSv3: Fix posix ACL code
Fix a memory leak due to allocation in the XDR layer. In cases where the RPC call needs to be retransmitted, we end up allocating new pages without clearing the old ones. Fix this by moving the allocation into nfs3_proc_setacls(). Also fix an issue discovered by Kevin Rudd, whereby the amount of memory reserved for the acls in the xdr_buf->head was miscalculated, and causing corruption. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/nfs_xdr.h2
-rw-r--r--include/linux/nfsacl.h3
2 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index a550b528319f..2e5f00066afd 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -406,6 +406,8 @@ struct nfs3_setaclargs {
406 int mask; 406 int mask;
407 struct posix_acl * acl_access; 407 struct posix_acl * acl_access;
408 struct posix_acl * acl_default; 408 struct posix_acl * acl_default;
409 size_t len;
410 unsigned int npages;
409 struct page ** pages; 411 struct page ** pages;
410}; 412};
411 413
diff --git a/include/linux/nfsacl.h b/include/linux/nfsacl.h
index 54487a99beb8..43011b69297c 100644
--- a/include/linux/nfsacl.h
+++ b/include/linux/nfsacl.h
@@ -37,6 +37,9 @@
37#define NFSACL_MAXPAGES ((2*(8+12*NFS_ACL_MAX_ENTRIES) + PAGE_SIZE-1) \ 37#define NFSACL_MAXPAGES ((2*(8+12*NFS_ACL_MAX_ENTRIES) + PAGE_SIZE-1) \
38 >> PAGE_SHIFT) 38 >> PAGE_SHIFT)
39 39
40#define NFS_ACL_MAX_ENTRIES_INLINE (5)
41#define NFS_ACL_INLINE_BUFSIZE ((2*(2+3*NFS_ACL_MAX_ENTRIES_INLINE)) << 2)
42
40static inline unsigned int 43static inline unsigned int
41nfsacl_size(struct posix_acl *acl_access, struct posix_acl *acl_default) 44nfsacl_size(struct posix_acl *acl_access, struct posix_acl *acl_default)
42{ 45{