patch for 2.5.42. 1/2

From: Hu Gang (hugang@soulinfo.com)
Date: Sat Oct 12 2002 - 22:20:36 EST


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





- 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 : Tue Oct 15 2002 - 22:00:45 EST