Patchwork [3.5.y.z,extended,stable] Patch "ext4: init pagevec in ext4_da_block_invalidatepages" has been added to staging queue

mail settings
Submitter Herton Ronaldo Krzesinski
Date Jan. 7, 2013, 8:33 p.m.
Message ID <>
Download mbox | patch
Permalink /patch/210139/
State New
Headers show


Herton Ronaldo Krzesinski - Jan. 7, 2013, 8:33 p.m.
This is a note to let you know that I have just added a patch titled

    ext4: init pagevec in ext4_da_block_invalidatepages

to the linux-3.5.y-queue branch of the 3.5.y.z extended stable tree 
which can be found at:;a=shortlog;h=refs/heads/linux-3.5.y-queue

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.5.y.z tree, see



From 8608d2c6dd69e4e4a1a858ebc3cd3891b284bab5 Mon Sep 17 00:00:00 2001
From: Eric Sandeen <>
Date: Wed, 14 Nov 2012 22:22:05 -0500
Subject: [PATCH] ext4: init pagevec in ext4_da_block_invalidatepages

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

Reviewed-by: Lukas Czerner <>
Reviewed-by: Carlos Maiolino <>
Signed-off-by: Eric Sandeen <>
Signed-off-by: "Theodore Ts'o" <>
[ herton: adjust context ]
Signed-off-by: Herton Ronaldo Krzesinski <>
 fs/ext4/inode.c |    2 ++
 1 file changed, 2 insertions(+)



diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 9e9aed3..75f537f 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -1491,6 +1491,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)