]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ext4: init pagevec in ext4_da_block_invalidatepages
authorEric Sandeen <sandeen@redhat.com>
Thu, 15 Nov 2012 03:22:05 +0000 (22:22 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 21 Jan 2013 19:44:59 +0000 (11:44 -0800)
commit 66bea92c69477a75a5d37b9bfed5773c92a3c4b4 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>
fs/ext4/inode.c

index 1dbf758c49647585fe6b2bc866be4d7c966a3857..7e56946a5199b18f81062979df00f7ede5ac1628 100644 (file)
@@ -2199,6 +2199,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)