Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=232b14328050a4639130b0dec185f43968e72035
Commit:     232b14328050a4639130b0dec185f43968e72035
Parent:     2776365370b579afc36cff14dc70a567b66f0378
Author:     Rafael J. Wysocki <[EMAIL PROTECTED]>
AuthorDate: Thu Oct 18 03:04:44 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Thu Oct 18 14:37:18 2007 -0700

    freezer: do not sync filesystems from freeze_processes
    
    The syncing of filesystems from within the freezer is generally not needed.
    Also, if there's an ext3 filesystem loopback-mounted from a FUSE one, the
    syncing results in writes to it and deadlocks.  Similarly, it will deadlock 
if
    FUSE implements sync.
    
    Change freeze_processes() so that it doesn't execute sys_sync() and make the
    suspend and hibernation code path sync filesystems independently of the
    freezer.
    
    Signed-off-by: Rafael J. Wysocki <[EMAIL PROTECTED]>
    Acked-by: Pavel Machek <[EMAIL PROTECTED]>
    Cc: Nigel Cunningham <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 kernel/power/disk.c    |    4 ++++
 kernel/power/main.c    |    6 ++++++
 kernel/power/process.c |    1 -
 kernel/power/user.c    |    4 ++++
 4 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/kernel/power/disk.c b/kernel/power/disk.c
index 9348d95..555c0f0 100644
--- a/kernel/power/disk.c
+++ b/kernel/power/disk.c
@@ -313,6 +313,10 @@ int hibernate(void)
        if (error)
                goto Exit;
 
+       printk("Syncing filesystems ... ");
+       sys_sync();
+       printk("done.\n");
+
        error = prepare_processes();
        if (error)
                goto Finish;
diff --git a/kernel/power/main.c b/kernel/power/main.c
index fb2412e..3cdf95b 100644
--- a/kernel/power/main.c
+++ b/kernel/power/main.c
@@ -20,6 +20,7 @@
 #include <linux/resume-trace.h>
 #include <linux/freezer.h>
 #include <linux/vmstat.h>
+#include <linux/syscalls.h>
 
 #include "power.h"
 
@@ -230,9 +231,14 @@ static int enter_state(suspend_state_t state)
 
        if (!valid_state(state))
                return -ENODEV;
+
        if (!mutex_trylock(&pm_mutex))
                return -EBUSY;
 
+       printk("Syncing filesystems ... ");
+       sys_sync();
+       printk("done.\n");
+
        pr_debug("PM: Preparing system for %s sleep\n", pm_states[state]);
        if ((error = suspend_prepare()))
                goto Unlock;
diff --git a/kernel/power/process.c b/kernel/power/process.c
index 3434940..dba2f3a 100644
--- a/kernel/power/process.c
+++ b/kernel/power/process.c
@@ -191,7 +191,6 @@ int freeze_processes(void)
        if (error)
                return error;
 
-       sys_sync();
        error = try_to_freeze_tasks(FREEZER_KERNEL_THREADS);
        if (error)
                return error;
diff --git a/kernel/power/user.c b/kernel/power/user.c
index bd0723a..5bd321b 100644
--- a/kernel/power/user.c
+++ b/kernel/power/user.c
@@ -153,6 +153,10 @@ static int snapshot_ioctl(struct inode *inode, struct file 
*filp,
                mutex_lock(&pm_mutex);
                error = pm_notifier_call_chain(PM_HIBERNATION_PREPARE);
                if (!error) {
+                       printk("Syncing filesystems ... ");
+                       sys_sync();
+                       printk("done.\n");
+
                        error = freeze_processes();
                        if (error)
                                thaw_processes();
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to