diff options
-rw-r--r-- | kernel/power/disk.c | 4 | ||||
-rw-r--r-- | kernel/power/main.c | 6 | ||||
-rw-r--r-- | kernel/power/process.c | 1 | ||||
-rw-r--r-- | 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 9348d95a4fb8..555c0f0b2f7e 100644 --- a/kernel/power/disk.c +++ b/kernel/power/disk.c | |||
@@ -313,6 +313,10 @@ int hibernate(void) | |||
313 | if (error) | 313 | if (error) |
314 | goto Exit; | 314 | goto Exit; |
315 | 315 | ||
316 | printk("Syncing filesystems ... "); | ||
317 | sys_sync(); | ||
318 | printk("done.\n"); | ||
319 | |||
316 | error = prepare_processes(); | 320 | error = prepare_processes(); |
317 | if (error) | 321 | if (error) |
318 | goto Finish; | 322 | goto Finish; |
diff --git a/kernel/power/main.c b/kernel/power/main.c index fb2412e7a0ce..3cdf95b1dc92 100644 --- a/kernel/power/main.c +++ b/kernel/power/main.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <linux/resume-trace.h> | 20 | #include <linux/resume-trace.h> |
21 | #include <linux/freezer.h> | 21 | #include <linux/freezer.h> |
22 | #include <linux/vmstat.h> | 22 | #include <linux/vmstat.h> |
23 | #include <linux/syscalls.h> | ||
23 | 24 | ||
24 | #include "power.h" | 25 | #include "power.h" |
25 | 26 | ||
@@ -230,9 +231,14 @@ static int enter_state(suspend_state_t state) | |||
230 | 231 | ||
231 | if (!valid_state(state)) | 232 | if (!valid_state(state)) |
232 | return -ENODEV; | 233 | return -ENODEV; |
234 | |||
233 | if (!mutex_trylock(&pm_mutex)) | 235 | if (!mutex_trylock(&pm_mutex)) |
234 | return -EBUSY; | 236 | return -EBUSY; |
235 | 237 | ||
238 | printk("Syncing filesystems ... "); | ||
239 | sys_sync(); | ||
240 | printk("done.\n"); | ||
241 | |||
236 | pr_debug("PM: Preparing system for %s sleep\n", pm_states[state]); | 242 | pr_debug("PM: Preparing system for %s sleep\n", pm_states[state]); |
237 | if ((error = suspend_prepare())) | 243 | if ((error = suspend_prepare())) |
238 | goto Unlock; | 244 | goto Unlock; |
diff --git a/kernel/power/process.c b/kernel/power/process.c index 3434940a3df1..dba2f3acb4f8 100644 --- a/kernel/power/process.c +++ b/kernel/power/process.c | |||
@@ -191,7 +191,6 @@ int freeze_processes(void) | |||
191 | if (error) | 191 | if (error) |
192 | return error; | 192 | return error; |
193 | 193 | ||
194 | sys_sync(); | ||
195 | error = try_to_freeze_tasks(FREEZER_KERNEL_THREADS); | 194 | error = try_to_freeze_tasks(FREEZER_KERNEL_THREADS); |
196 | if (error) | 195 | if (error) |
197 | return error; | 196 | return error; |
diff --git a/kernel/power/user.c b/kernel/power/user.c index bd0723a7df3f..5bd321bcbb75 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, | |||
153 | mutex_lock(&pm_mutex); | 153 | mutex_lock(&pm_mutex); |
154 | error = pm_notifier_call_chain(PM_HIBERNATION_PREPARE); | 154 | error = pm_notifier_call_chain(PM_HIBERNATION_PREPARE); |
155 | if (!error) { | 155 | if (!error) { |
156 | printk("Syncing filesystems ... "); | ||
157 | sys_sync(); | ||
158 | printk("done.\n"); | ||
159 | |||
156 | error = freeze_processes(); | 160 | error = freeze_processes(); |
157 | if (error) | 161 | if (error) |
158 | thaw_processes(); | 162 | thaw_processes(); |