[PATCH] unlock_page when get_swap_bio fails

Hugh Dickins (hugh@veritas.com)
Mon, 11 Nov 2002 18:08:15 +0000 (GMT)


swap_readpage and swap_writepage forgot
to unlock_page if get_swap_bio failed.

Patch applies to 2.5.47 or 2.5.47-mm1.

--- 2.5.47/mm/page_io.c Mon Oct 7 20:37:50 2002
+++ linux/mm/page_io.c Mon Nov 11 17:01:27 2002
@@ -97,6 +97,7 @@
bio = get_swap_bio(GFP_NOIO, page, end_swap_bio_write);
if (bio == NULL) {
set_page_dirty(page);
+ unlock_page(page);
ret = -ENOMEM;
goto out;
}
@@ -116,6 +117,7 @@
ClearPageUptodate(page);
bio = get_swap_bio(GFP_KERNEL, page, end_swap_bio_read);
if (bio == NULL) {
+ unlock_page(page);
ret = -ENOMEM;
goto out;
}

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/