--Multipart_Sun__13_Oct_2002_11:20:36_+0800_0b9bc098
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Hello Pavel Machek:
This patch can fix, That if run suspend without swaping device/file will Oops.
--- linux-2.5.42/kernel/suspend.c Sat Oct 12 21:25:06 2002
+++ linux-2.5.42-suspend/kernel/suspend.c Sat Oct 12 21:28:03 2002
@@ -309,6 +309,9 @@
union diskpage *cur;
struct page *page;
+ if (root_swap == 0xFFFF) /* ignored */
+ return;
+
page = alloc_page(GFP_ATOMIC);
if (!page)
panic("Out of memory in mark_swapfiles");
@@ -686,6 +689,7 @@
if(nr_free_pages() < nr_needed_pages) {
printk(KERN_CRIT "%sCouldn't get enough free pages, on %d pages short\n",
name_suspend, nr_needed_pages-nr_free_pages());
+ root_swap = 0xFFFF;
spin_unlock_irq(&suspend_pagedir_lock);
return 1;
}
@@ -843,8 +847,10 @@
PRINTK("Syncing disks before copy\n");
do_suspend_sync();
+ PRINTK("Doing drivers_suspend\n");
/* Save state of all device drivers, and stop them. */
if(drivers_suspend()==0)
+ PRINTK("Doing do_magic(0)\n");
/* If stopping device drivers worked, we proceed basically into
* suspend_save_image.
*
-- - Hu Gang
--Multipart_Sun__13_Oct_2002_11:20:36_+0800_0b9bc098 Content-Type: text/plain; name="00000006.mimetmp" Content-Disposition: attachment; filename="00000006.mimetmp" Content-Transfer-Encoding: 7bit
Hello Pavel Machek:
This patch can fix, That if run suspend without swaping device/file will Oops.
--- linux-2.5.42/kernel/suspend.c Sat Oct 12 21:25:06 2002 +++ linux-2.5.42-suspend/kernel/suspend.c Sat Oct 12 21:28:03 2002 @@ -309,6 +309,9 @@ union diskpage *cur; struct page *page; + if (root_swap == 0xFFFF) /* ignored */ + return; + page = alloc_page(GFP_ATOMIC); if (!page) panic("Out of memory in mark_swapfiles"); @@ -686,6 +689,7 @@ if(nr_free_pages() < nr_needed_pages) { printk(KERN_CRIT "%sCouldn't get enough free pages, on %d pages short\n", name_suspend, nr_needed_pages-nr_free_pages()); + root_swap = 0xFFFF; spin_unlock_irq(&suspend_pagedir_lock); return 1; } @@ -843,8 +847,10 @@ PRINTK("Syncing disks before copy\n"); do_suspend_sync(); + PRINTK("Doing drivers_suspend\n"); /* Save state of all device drivers, and stop them. */ if(drivers_suspend()==0) + PRINTK("Doing do_magic(0)\n"); /* If stopping device drivers worked, we proceed basically into * suspend_save_image. *
-- - Hu Gang
--Multipart_Sun__13_Oct_2002_11:20:36_+0800_0b9bc098 Content-Type: text/plain; name="00000001.mimetmp" Content-Disposition: attachment; filename="00000001.mimetmp" Content-Transfer-Encoding: 7bit
Hello Pavel Machek:
This patch can fix, That if run suspend without swaping device/file will Oops.
--- linux-2.5.42/kernel/suspend.c Sat Oct 12 21:25:06 2002 +++ linux-2.5.42-suspend/kernel/suspend.c Sat Oct 12 21:28:03 2002 @@ -309,6 +309,9 @@ union diskpage *cur; struct page *page; + if (root_swap == 0xFFFF) /* ignored */ + return; + page = alloc_page(GFP_ATOMIC); if (!page) panic("Out of memory in mark_swapfiles"); @@ -686,6 +689,7 @@ if(nr_free_pages() < nr_needed_pages) { printk(KERN_CRIT "%sCouldn't get enough free pages, on %d pages short\n", name_suspend, nr_needed_pages-nr_free_pages()); + root_swap = 0xFFFF; spin_unlock_irq(&suspend_pagedir_lock); return 1; } @@ -843,8 +847,10 @@ PRINTK("Syncing disks before copy\n"); do_suspend_sync(); + PRINTK("Doing drivers_suspend\n"); /* Save state of all device drivers, and stop them. */ if(drivers_suspend()==0) + PRINTK("Doing do_magic(0)\n"); /* If stopping device drivers worked, we proceed basically into * suspend_save_image. *
-- - Hu Gang
--Multipart_Sun__13_Oct_2002_11:20:36_+0800_0b9bc098 Content-Type: application/pgp-signature; name="00000000.mimetmp" Content-Disposition: attachment; filename="00000000.mimetmp" Content-Transfer-Encoding: base64
LS0tLS1CRUdJTiBQR1AgU0lHTkFUVVJFLS0tLS0KVmVyc2lvbjogR251UEcgdjEuMi4wIChHTlUv TGludXgpCgppRDhEQlFFOXFDVGxQTTR1Q3k3YkFKZ1JBdkliQUp3THN1VlQrRGNtdVBCZlhudGV2 NHp0bU5DYTRBQ2VQT1Q3CkVQZ01lVDNLQ1NQNTU4SVl1MkFsOEdVPQo9bUs2MAotLS0tLUVORCBQ R1AgU0lHTkFUVVJFLS0tLS0KDQo=
--Multipart_Sun__13_Oct_2002_11:20:36_+0800_0b9bc098--
--=.5JPRKPueM,sNBi Content-Type: application/pgp-signature
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.0 (GNU/Linux)
iD8DBQE9qOaEPM4uCy7bAJgRApzjAJ9SJN/GO2n1zwBXShCNiT8is7WupACff+Zg s2TYjdS0Glvq01zVZRFKTu4= =F8n8 -----END PGP SIGNATURE-----
--=.5JPRKPueM,sNBi-- - 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/