NFSv4: include bitmap in nfsv4 get acl data
commitbd689a8cdbfe4cf5182f01aa93e4ba3fadf1f11c
authorAndy Adamson <andros@netapp.com>
Wed, 7 Dec 2011 16:55:27 +0000 (7 11:55 -0500)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 18 Jan 2012 15:31:55 +0000 (18 07:31 -0800)
tree75453fc4c5cc7e598a35a05dc7f3f5b88e0cdfa1
parent6ab1a5d77456d333674ed3b9a2bd3c29715965b6
NFSv4: include bitmap in nfsv4 get acl data

commit bf118a342f10dafe44b14451a1392c3254629a1f upstream.

The NFSv4 bitmap size is unbounded: a server can return an arbitrary
sized bitmap in an FATTR4_WORD0_ACL request.  Replace using the
nfs4_fattr_bitmap_maxsz as a guess to the maximum bitmask returned by a server
with the inclusion of the bitmap (xdr length plus bitmasks) and the acl data
xdr length to the (cached) acl page data.

This is a general solution to commit e5012d1f "NFSv4.1: update
nfs4_fattr_bitmap_maxsz" and fixes hitting a BUG_ON in xdr_shrink_bufhead
when getting ACLs.

Fix a bug in decode_getacl that returned -EINVAL on ACLs > page when getxattr
was called with a NULL buffer, preventing ACL > PAGE_SIZE from being retrieved.

Signed-off-by: Andy Adamson <andros@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/nfs/nfs4proc.c
fs/nfs/nfs4xdr.c
include/linux/nfs_xdr.h
include/linux/sunrpc/xdr.h
net/sunrpc/xdr.c