then in turn we can backout this bit (patch -R)
diff -urN 2.4.10pre11/mm/page_io.c 2.4.10pre12/mm/page_io.c
--- 2.4.10pre11/mm/page_io.c Tue May 1 19:35:33 2001
+++ 2.4.10pre12/mm/page_io.c Thu Sep 20 01:44:20 2001
@@ -78,7 +78,15 @@
if (!wait) {
SetPageDecrAfter(page);
atomic_inc(&nr_async_pages);
- }
+ } else
+ /*
+ * Must hold a reference until after wait_on_page()
+ * returned or it could be freed by the VM after
+ * I/O is completed and the page is been unlocked.
+ * The asynchronous path is fine since it never
+ * references the page after brw_page().
+ */
+ page_cache_get(page);
/* block_size == PAGE_SIZE/zones_used */
brw_page(rw, page, dev, zones, block_size);
@@ -94,6 +102,7 @@
/* This shouldn't happen, but check to be sure. */
if (page_count(page) == 0)
printk(KERN_ERR "rw_swap_page: page unused while waiting!\n");
+ page_cache_release(page);
return 1;
}
Andrea
-
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/