diff options
Diffstat (limited to 'fs/nfs/nfs4proc.c')
-rw-r--r-- | fs/nfs/nfs4proc.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 60d5f4c26dda..f5f125fdae1b 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -3684,19 +3684,23 @@ static ssize_t __nfs4_get_acl_uncached(struct inode *inode, void *buf, size_t bu | |||
3684 | if (npages == 0) | 3684 | if (npages == 0) |
3685 | npages = 1; | 3685 | npages = 1; |
3686 | 3686 | ||
3687 | /* Add an extra page to handle the bitmap returned */ | ||
3688 | npages++; | ||
3689 | |||
3687 | for (i = 0; i < npages; i++) { | 3690 | for (i = 0; i < npages; i++) { |
3688 | pages[i] = alloc_page(GFP_KERNEL); | 3691 | pages[i] = alloc_page(GFP_KERNEL); |
3689 | if (!pages[i]) | 3692 | if (!pages[i]) |
3690 | goto out_free; | 3693 | goto out_free; |
3691 | } | 3694 | } |
3692 | if (npages > 1) { | 3695 | |
3693 | /* for decoding across pages */ | 3696 | /* for decoding across pages */ |
3694 | res.acl_scratch = alloc_page(GFP_KERNEL); | 3697 | res.acl_scratch = alloc_page(GFP_KERNEL); |
3695 | if (!res.acl_scratch) | 3698 | if (!res.acl_scratch) |
3696 | goto out_free; | 3699 | goto out_free; |
3697 | } | 3700 | |
3698 | args.acl_len = npages * PAGE_SIZE; | 3701 | args.acl_len = npages * PAGE_SIZE; |
3699 | args.acl_pgbase = 0; | 3702 | args.acl_pgbase = 0; |
3703 | |||
3700 | /* Let decode_getfacl know not to fail if the ACL data is larger than | 3704 | /* Let decode_getfacl know not to fail if the ACL data is larger than |
3701 | * the page we send as a guess */ | 3705 | * the page we send as a guess */ |
3702 | if (buf == NULL) | 3706 | if (buf == NULL) |