Skip to content

Commit

Permalink
ext4: init pagevec in ext4_da_block_invalidatepages
Browse files Browse the repository at this point in the history
commit 66bea92 upstream.

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>
Signed-off-by: CAI Qian <caiqian@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Eric Sandeen authored and fefifofum committed Oct 10, 2015
1 parent 46636bd commit dfd7d6c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fs/ext4/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1425,6 +1425,8 @@ static void ext4_da_block_invalidatepages(struct mpage_da_data *mpd)

index = mpd->first_page;
end = mpd->next_page - 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 dfd7d6c

Please sign in to comment.