[PATCH] unlock_page when get_swap_bio fails

From: Hugh Dickins (hugh@veritas.com)
Date: Mon Nov 11 2002 - 13:08:15 EST


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/



This archive was generated by hypermail 2b29 : Fri Nov 15 2002 - 22:00:22 EST