Skip to contentSkip to conversation

ext4: init pagevec in ext4_da_block_invalidatepages

PATCH Superseded Eric Sandeen 4 participants 5 messages Nov 11, 2012 – Nov 13, 2012 ext4 file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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()

---

fs/ext4/inode.c +2 -0
index b3c243b..f89c0e5 100644
@@ -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)
#1 lore raw

PATCH v2 1/1 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()

---

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

fs/ext4/inode.c +2 -0
index b3c243b..f89c0e5 100644
@@ -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

Reviewed-by on v2 1/1
#2 lore raw
Quoted 11 lines · Eric Sandeen

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.

Quoted 33 lines

---

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

fs/ext4/inode.c +2 -1
index b3c243b..f89c0e5 100644
@@ -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

Reviewed-by on v2 1/1
#3 lore raw
In reply to Eric Sandeen
Quoted 20 lines · Eric Sandeen

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

---

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

fs/ext4/inode.c +0 -0
index b3c243b..f89c0e5 100644

fs/ext4/inode.c static void ext4_da_block_invalidatepages(struct mpage_da_data *mpd) · line 1510

Quoted 8 lines
fs/ext4/inode.c +2 -0
@@ -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,

Signature · 1 line
Carlos