Skip to content

Commit

Permalink
ext4: init pagevec in ext4_da_block_invalidatepages
Browse files Browse the repository at this point in the history
ext4_da_block_invalidatepages is missing a pagevec_init(),
which means that pvec->cold contains random garbage.

This affects whether the page goes to the front or
back of the LRU when ->cold makes it to
free_hot_cold_page()

Reviewed-by: Lukas Czerner <lczerner@redhat.com>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Cc: stable@vger.kernel.org
  • Loading branch information
Eric Sandeen authored and tytso committed Nov 15, 2012
1 parent c6af880 commit 66bea92
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions fs/ext4/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1482,6 +1482,7 @@ static void ext4_da_block_invalidatepages(struct mpage_da_data *mpd)
last = end << (PAGE_CACHE_SHIFT - inode->i_blkbits);
ext4_es_remove_extent(inode, start, last - start + 1);

pagevec_init(&pvec, 0);
while (index <= end) {
nr_pages = pagevec_lookup(&pvec, mapping, index, PAGEVEC_SIZE);
if (nr_pages == 0)
Expand Down

0 comments on commit 66bea92

Please sign in to comment.