Commit 9b1d0998 authored by Jan Kara's avatar Jan Kara Committed by Theodore Ts'o

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: default avatarWu Fengguang <fengguang.wu@intel.com>
Signed-off-by: default avatarJan Kara <jack@suse.cz>
Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
parent 67eeb568
...@@ -2157,17 +2157,16 @@ static void ext4_da_block_invalidatepages(struct mpage_da_data *mpd, ...@@ -2157,17 +2157,16 @@ static void ext4_da_block_invalidatepages(struct mpage_da_data *mpd,
break; break;
for (i = 0; i < nr_pages; i++) { for (i = 0; i < nr_pages; i++) {
struct page *page = pvec.pages[i]; struct page *page = pvec.pages[i];
index = page->index; if (page->index > end)
if (index > end)
break; break;
index++;
BUG_ON(!PageLocked(page)); BUG_ON(!PageLocked(page));
BUG_ON(PageWriteback(page)); BUG_ON(PageWriteback(page));
block_invalidatepage(page, 0); block_invalidatepage(page, 0);
ClearPageUptodate(page); ClearPageUptodate(page);
unlock_page(page); unlock_page(page);
} }
index = pvec.pages[nr_pages - 1]->index + 1;
pagevec_release(&pvec);
} }
return; return;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment