History

[PATCH] fix race in pagevec_strip?

We can call try_to_release_page() with PagePrivate off and a valid page->mapping This may cause all sorts of trouble for the filesystem *_releasepage() handlers. XFS bombs out in that case. Lock the page before checking for page private.

Christoph Lameter committed 20 years ago

Commit 5b40dc71 parent 8ba32fd1 file · +2 −1Browse files

Unified · Split

mm/swap.c+2−1
@@ -393,7 +393,8 @@ void pagevec_strip(struct pagevec *pvec) · 392 unmodified lines
393393 struct page *page = pvec->pages[i];
394394
395395 if (PagePrivate(page) && !TestSetPageLocked(page)) {
396− try_to_release_page(page, 0);
396+ if (PagePrivate(page))
397+ try_to_release_page(page, 0);
397398 unlock_page(page);
398399 }
399400 }