]> git.karo-electronics.de Git - karo-tx-linux.git/commit
NFSv4: fix getacl ERANGE for some ACL buffer sizes
authorWeston Andros Adamson <dros@netapp.com>
Thu, 21 Nov 2013 21:20:13 +0000 (16:20 -0500)
committerJ. Bruce Fields <bfields@redhat.com>
Thu, 14 Jan 2016 22:32:52 +0000 (17:32 -0500)
commitee2bf98bbe908a4a9572886497a7dec0a3a4c003
tree80448fa8c9666065bbaa36639f22ef09672e0b21
parent6e8b50d16a757d53f8817acecba97c5d4aa1cf65
NFSv4: fix getacl ERANGE for some ACL buffer sizes

Fix a bug where getxattr returns ERANGE when the attr buffer
length is close enough to the nearest PAGE_SIZE multiple that adding
the extra bytes leaves too little room for the ACL buffer.

Besides storing the ACL buffer, the getacl decoder uses the inline
pages for the attr bitmap and buffer length. __nfs4_get_acl_uncached
must allocate enough page space for all of the data to be decoded.

This patch uses xdr_partial_copy_from_skb to allocate any needed
pages past the first one. This allows the client to always cache the acl
on the first getacl call and not just if it fits in one page.

Signed-off-by: Weston Andros Adamson <dros@netapp.com>
[bfields: restore call to xdr_enter_page]
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfs/nfs4proc.c