diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2007-10-18 03:04:44 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-18 14:37:18 -0700 |
commit | 232b14328050a4639130b0dec185f43968e72035 (patch) | |
tree | eb3b525278bd3efd5403bc4f5cfb3e41614d40c4 /kernel/power/main.c | |
parent | 2776365370b579afc36cff14dc70a567b66f0378 (diff) | |
download | op-kernel-dev-232b14328050a4639130b0dec185f43968e72035.zip op-kernel-dev-232b14328050a4639130b0dec185f43968e72035.tar.gz |
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 <rjw@sisk.pl>
Acked-by: Pavel Machek <pavel@ucw.cz>
Cc: Nigel Cunningham <nigel@nigel.suspend2.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/power/main.c')
-rw-r--r-- | kernel/power/main.c | 6 |
1 files changed, 6 insertions, 0 deletions
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; |