Commit a83d50bc authored by Kinglong Mee's avatar Kinglong Mee Committed by Jaegeuk Kim

f2fs: fix bad prefetchw of NULL page

For f2fs_read_data_pages, the f2fs_mpage_readpages gets "page == NULL",
so that, the prefetchw(&page->flags) is operated on NULL.

Fixes: f1e88660 ("f2fs: expose f2fs_mpage_readpages")
Signed-off-by: default avatarKinglong Mee <kinglongmee@gmail.com>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent bd4667cb
...@@ -1151,9 +1151,10 @@ static int f2fs_mpage_readpages(struct address_space *mapping, ...@@ -1151,9 +1151,10 @@ static int f2fs_mpage_readpages(struct address_space *mapping,
for (page_idx = 0; nr_pages; page_idx++, nr_pages--) { for (page_idx = 0; nr_pages; page_idx++, nr_pages--) {
prefetchw(&page->flags);
if (pages) { if (pages) {
page = list_last_entry(pages, struct page, lru); page = list_last_entry(pages, struct page, lru);
prefetchw(&page->flags);
list_del(&page->lru); list_del(&page->lru);
if (add_to_page_cache_lru(page, mapping, if (add_to_page_cache_lru(page, mapping,
page->index, page->index,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment