aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/blocklayout
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2015-08-17 18:40:58 +0200
committerTrond Myklebust <trond.myklebust@primarydata.com>2015-08-17 13:22:49 -0500
commit68596bd188e5e621c28a2f6fc0a3dd80a606d16b (patch)
treea615f5fc74722bd001d544b7221c3186bfc8c45a /fs/nfs/blocklayout
parentpnfs/blocklayout: calculate layoutupdate size correctly (diff)
downloadlinux-dev-68596bd188e5e621c28a2f6fc0a3dd80a606d16b.tar.xz
linux-dev-68596bd188e5e621c28a2f6fc0a3dd80a606d16b.zip
pnfs/blocklayout: set up layoutupdate_pages properly
We need to replace the __be32 with a void pointer to do proper arithmentics on the virtual addresses so that we can get the right page pointers. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to 'fs/nfs/blocklayout')
-rw-r--r--fs/nfs/blocklayout/extent_tree.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/fs/nfs/blocklayout/extent_tree.c b/fs/nfs/blocklayout/extent_tree.c
index 7536036fb526..a11b759d294a 100644
--- a/fs/nfs/blocklayout/extent_tree.c
+++ b/fs/nfs/blocklayout/extent_tree.c
@@ -558,14 +558,11 @@ retry:
arg->layoutupdate_len = ext_tree_layoutupdate_size(count);
if (unlikely(arg->layoutupdate_pages != &arg->layoutupdate_page)) {
- __be32 *p = start_p;
+ void *p = start_p, *end = p + arg->layoutupdate_len;
int i = 0;
- for (p = start_p;
- p < start_p + arg->layoutupdate_len;
- p += PAGE_SIZE) {
+ for ( ; p < end; p += PAGE_SIZE)
arg->layoutupdate_pages[i++] = vmalloc_to_page(p);
- }
}
dprintk("%s found %zu ranges\n", __func__, count);