Skip to contentSkip to conversation

fix page number calculation bug for block layout decode buffer

PATCH New Jim Rees 1 participant 1 message Apr 10, 2012

Subsystems (2)
lore
Share & tools
lore

Jim Rees

author
#0 lore raw

PATCH v2 1/1 fix page number calculation bug for block layout decode buffer

---
 fs/nfs/blocklayout/blocklayout.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
fs/nfs/blocklayout/blocklayout.c +3 -1
index 48cfac3..0418252 100644
@@ -38,6 +38,8 @@
 #include <linux/buffer_head.h>	/* various write calls */
 #include <linux/prefetch.h>
 
+#include "../pnfs.h"
+#include "../internal.h"
 #include "blocklayout.h"
 
 #define NFSDBG_FACILITY	NFSDBG_PNFS_LD
@@ -872,7 +874,7 @@ nfs4_blk_get_deviceinfo(struct nfs_server *server, const struct nfs_fh *fh,
 	 * 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 max_resp_sz %u max_pages %d\n",
 		__func__, max_resp_sz, max_pages);
 
Signature · 1 line
1.7.5.4