Skip to content

Commit

Permalink
NFSv4.1 fix page number calculation bug for filelayout decode buffers
Browse files Browse the repository at this point in the history
Signed-off-by: Andy Adamson <[email protected]>
Signed-off-by: Trond Myklebust <[email protected]>
  • Loading branch information
androsadamson authored and Trond Myklebust committed Apr 26, 2012
1 parent 9526b2b commit e5265a0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion fs/nfs/nfs4filelayoutdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@ get_device_info(struct inode *inode, struct nfs4_deviceid *dev_id, gfp_t gfp_fla
* GETDEVICEINFO's maxcount
*/
max_resp_sz = server->nfs_client->cl_session->fc_attrs.max_resp_sz;
max_pages = max_resp_sz >> PAGE_SHIFT;
max_pages = nfs_page_array_len(0, max_resp_sz);
dprintk("%s inode %p max_resp_sz %u max_pages %d\n",
__func__, inode, max_resp_sz, max_pages);

Expand Down
2 changes: 1 addition & 1 deletion fs/nfs/pnfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ send_layoutget(struct pnfs_layout_hdr *lo,

/* allocate pages for xdr post processing */
max_resp_sz = server->nfs_client->cl_session->fc_attrs.max_resp_sz;
max_pages = max_resp_sz >> PAGE_SHIFT;
max_pages = nfs_page_array_len(0, max_resp_sz);

pages = kcalloc(max_pages, sizeof(struct page *), gfp_flags);
if (!pages)
Expand Down

0 comments on commit e5265a0

Please sign in to comment.