2012-11-11 21:33:36

by Eric Sandeen

[permalink] [raw]
Subject: [PATCH] ext4: init pagevec in ext4_da_block_invalidatepages

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()

Signed-off-by: Eric Sandeen <[email protected]>
---

diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index b3c243b..f89c0e5 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -1503,6 +1503,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)



2012-11-11 21:50:42

by Eric Sandeen

[permalink] [raw]
Subject: [PATCH V2] ext4: init pagevec in ext4_da_block_invalidatepages

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()

Signed-off-by: Eric Sandeen <[email protected]>
Cc: [email protected]
---

(resend w/ stable in S-O-B area rather than fat-fingered
in email cc :/ )

diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index b3c243b..f89c0e5 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -1503,6 +1503,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)

2012-11-12 07:35:22

by Lukas Czerner

[permalink] [raw]
Subject: Re: [PATCH V2] ext4: init pagevec in ext4_da_block_invalidatepages

On Sun, 11 Nov 2012, Eric Sandeen wrote:

> Date: Sun, 11 Nov 2012 15:50:37 -0600
> From: Eric Sandeen <[email protected]>
> To: ext4 development <[email protected]>
> Subject: [PATCH V2] ext4: init pagevec in ext4_da_block_invalidatepages
>
> 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()

Looks good.

Reviewed-by: Lukas Czerner <[email protected]>

>
> Signed-off-by: Eric Sandeen <[email protected]>
> Cc: [email protected]
> ---
>
> (resend w/ stable in S-O-B area rather than fat-fingered
> in email cc :/ )
>
> diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
> index b3c243b..f89c0e5 100644
> --- a/fs/ext4/inode.c
> +++ b/fs/ext4/inode.c
> @@ -1503,6 +1503,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)
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>

2012-11-12 14:13:02

by Carlos Maiolino

[permalink] [raw]
Subject: Re: [PATCH V2] ext4: init pagevec in ext4_da_block_invalidatepages

On Sun, Nov 11, 2012 at 03:50:37PM -0600, Eric Sandeen wrote:
> 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()
>
> Signed-off-by: Eric Sandeen <[email protected]>
> Cc: [email protected]
> ---
>
> (resend w/ stable in S-O-B area rather than fat-fingered
> in email cc :/ )
>
> diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
> index b3c243b..f89c0e5 100644
> --- a/fs/ext4/inode.c
> +++ b/fs/ext4/inode.c
> @@ -1503,6 +1503,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)
>

Looks Good,

Reviewed-by: Carlos Maiolino <[email protected]>

--
Carlos

2012-11-13 05:15:04

by Theodore Ts'o

[permalink] [raw]
Subject: Re: [PATCH V2] ext4: init pagevec in ext4_da_block_invalidatepages

On Sun, Nov 11, 2012 at 03:50:37PM -0600, Eric Sandeen wrote:
> 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()
>
> Signed-off-by: Eric Sandeen <[email protected]>
> Cc: [email protected]

Applied, thanks.

- Ted