Skip to contentSkip to conversation

NFSv4.1 fix page number calulation bug for filelayout decode buffer

PATCH New [email protected] 1 participant 2 messages Apr 9, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover NFSv4.1 fix page number calulation bug for filelayout decode buffer

From: Andy Adamson <[email protected]>

This fixes a bug when performing I/O over pNFS file layout with rsize and/or wsize < PAGE_SIZE.

Andy Adamson (1):
NFSv4.1 fix page number calulation bug for filelayout decode buffer

 fs/nfs/nfs4filelayoutdev.c |    2 +-
 fs/nfs/pnfs.c              |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
Signature · 1 line
1.7.6.4
#1 lore raw

PATCH 1/1 NFSv4.1 fix page number calulation bug for filelayout decode buffer

From: Andy Adamson <[email protected]>

---
 fs/nfs/nfs4filelayoutdev.c |    2 +-
 fs/nfs/pnfs.c              |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
fs/nfs/nfs4filelayoutdev.c +1 -1
index a866bbd..696e448 100644
@@ -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 = (max_resp_sz + PAGE_SIZE - 1) >> PAGE_SHIFT;
 	dprintk("%s inode %p max_resp_sz %u max_pages %d\n",
 		__func__, inode, max_resp_sz, max_pages);
 
fs/nfs/pnfs.c +1 -1
index b5d4515..b73af2e 100644
@@ -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 = (max_resp_sz + PAGE_SIZE - 1) >> PAGE_SHIFT;
 
 	pages = kcalloc(max_pages, sizeof(struct page *), gfp_flags);
 	if (!pages)
Signature · 1 line
1.7.6.4