Commit 27c02b00 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] handle BIO allocation failures in swap_writepage()

If allocation of a BIO for swap writeout fails, mark the page dirty
again to save it from eviction.
parent 2ffe5f2f
...@@ -98,6 +98,7 @@ int swap_writepage(struct page *page) ...@@ -98,6 +98,7 @@ int swap_writepage(struct page *page)
} }
bio = get_swap_bio(GFP_NOIO, page, end_swap_bio_write); bio = get_swap_bio(GFP_NOIO, page, end_swap_bio_write);
if (bio == NULL) { if (bio == NULL) {
set_page_dirty(page);
ret = -ENOMEM; ret = -ENOMEM;
goto out; goto out;
} }
......
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