summaryrefslogtreecommitdiffstats
path: root/fs/ext4
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2010-03-03 16:19:32 -0500
committerTheodore Ts'o <tytso@mit.edu>2010-03-03 16:19:32 -0500
commit9b1d0998d24f9c207d5fbdd0b8bac07284e0eda7 (patch)
tree0670c100d74086884c772e72d3e4135b57118515 /fs/ext4
parent67eeb5685d2a211c0252ac7884142e503c759500 (diff)
downloadlinux-9b1d0998d24f9c207d5fbdd0b8bac07284e0eda7.tar.bz2
ext4: Release page references acquired in ext4_da_block_invalidatepages
We forget to release page references we acquire in ext4_da_block_invalidatepages. Luckily, this function gets called only if we are not able to allocate blocks for delay-allocated data so that function should better never be called. Also cleanup handling of index variable. Reported-by: Wu Fengguang <fengguang.wu@intel.com> Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4')
-rw-r--r--fs/ext4/inode.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index c717a74f2178..f55df7192b95 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -2157,17 +2157,16 @@ static void ext4_da_block_invalidatepages(struct mpage_da_data *mpd,
break;
for (i = 0; i < nr_pages; i++) {
struct page *page = pvec.pages[i];
- index = page->index;
- if (index > end)
+ if (page->index > end)
break;
- index++;
-
BUG_ON(!PageLocked(page));
BUG_ON(PageWriteback(page));
block_invalidatepage(page, 0);
ClearPageUptodate(page);
unlock_page(page);
}
+ index = pvec.pages[nr_pages - 1]->index + 1;
+ pagevec_release(&pvec);
}
return;
}