diff options
-rw-r--r-- | fs/nfs/blocklayout/extent_tree.c | 10 | ||||
-rw-r--r-- | include/linux/nfs_xdr.h | 1 |
2 files changed, 9 insertions, 2 deletions
diff --git a/fs/nfs/blocklayout/extent_tree.c b/fs/nfs/blocklayout/extent_tree.c index c59a59c37f3d..35ab51c04814 100644 --- a/fs/nfs/blocklayout/extent_tree.c +++ b/fs/nfs/blocklayout/extent_tree.c | |||
@@ -476,6 +476,7 @@ static void ext_tree_free_commitdata(struct nfs4_layoutcommit_args *arg, | |||
476 | 476 | ||
477 | for (i = 0; i < nr_pages; i++) | 477 | for (i = 0; i < nr_pages; i++) |
478 | put_page(arg->layoutupdate_pages[i]); | 478 | put_page(arg->layoutupdate_pages[i]); |
479 | vfree(arg->start_p); | ||
479 | kfree(arg->layoutupdate_pages); | 480 | kfree(arg->layoutupdate_pages); |
480 | } else { | 481 | } else { |
481 | put_page(arg->layoutupdate_page); | 482 | put_page(arg->layoutupdate_page); |
@@ -559,10 +560,15 @@ retry: | |||
559 | 560 | ||
560 | if (unlikely(arg->layoutupdate_pages != &arg->layoutupdate_page)) { | 561 | if (unlikely(arg->layoutupdate_pages != &arg->layoutupdate_page)) { |
561 | void *p = start_p, *end = p + arg->layoutupdate_len; | 562 | void *p = start_p, *end = p + arg->layoutupdate_len; |
563 | struct page *page = NULL; | ||
562 | int i = 0; | 564 | int i = 0; |
563 | 565 | ||
564 | for ( ; p < end; p += PAGE_SIZE) | 566 | arg->start_p = start_p; |
565 | arg->layoutupdate_pages[i++] = vmalloc_to_page(p); | 567 | for ( ; p < end; p += PAGE_SIZE) { |
568 | page = vmalloc_to_page(p); | ||
569 | arg->layoutupdate_pages[i++] = page; | ||
570 | get_page(page); | ||
571 | } | ||
566 | } | 572 | } |
567 | 573 | ||
568 | dprintk("%s found %zu ranges\n", __func__, count); | 574 | dprintk("%s found %zu ranges\n", __func__, count); |
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h index 791098a08a87..d320906cf13e 100644 --- a/include/linux/nfs_xdr.h +++ b/include/linux/nfs_xdr.h | |||
@@ -275,6 +275,7 @@ struct nfs4_layoutcommit_args { | |||
275 | size_t layoutupdate_len; | 275 | size_t layoutupdate_len; |
276 | struct page *layoutupdate_page; | 276 | struct page *layoutupdate_page; |
277 | struct page **layoutupdate_pages; | 277 | struct page **layoutupdate_pages; |
278 | __be32 *start_p; | ||
278 | }; | 279 | }; |
279 | 280 | ||
280 | struct nfs4_layoutcommit_res { | 281 | struct nfs4_layoutcommit_res { |