Commit 5dba7057 authored by Nathan Scott's avatar Nathan Scott

[XFS] Fix regression when running in laptop mode, causes hangs on sync.

SGI Modid: xfs-linux:xfs-kern:19744a
Signed-off-by: default avatarNathan Scott <nathans@sgi.com>
parent fea24af5
...@@ -491,7 +491,13 @@ xfssyncd( ...@@ -491,7 +491,13 @@ xfssyncd(
break; break;
spin_lock(&vfsp->vfs_sync_lock); spin_lock(&vfsp->vfs_sync_lock);
if (!timeleft) { /*
* We can get woken by laptop mode, to do a sync -
* that's the (only!) case where the list would be
* empty with time remaining.
*/
if (!timeleft || list_empty(&vfsp->vfs_sync_list)) {
if (!timeleft)
timeleft = (xfs_syncd_centisecs * HZ) / 100; timeleft = (xfs_syncd_centisecs * HZ) / 100;
INIT_LIST_HEAD(&vfsp->vfs_sync_work.w_list); INIT_LIST_HEAD(&vfsp->vfs_sync_work.w_list);
list_add_tail(&vfsp->vfs_sync_work.w_list, list_add_tail(&vfsp->vfs_sync_work.w_list,
...@@ -595,9 +601,10 @@ linvfs_sync_super( ...@@ -595,9 +601,10 @@ linvfs_sync_super(
if (unlikely(laptop_mode)) { if (unlikely(laptop_mode)) {
int prev_sync_seq = vfsp->vfs_sync_seq; int prev_sync_seq = vfsp->vfs_sync_seq;
/* /*
* The disk must be active because we're syncing. * The disk must be active because we're syncing.
* We schedule syncd now (now that the disk is * We schedule xfssyncd now (now that the disk is
* active) instead of later (when it might not be). * active) instead of later (when it might not be).
*/ */
wake_up_process(vfsp->vfs_sync_task); wake_up_process(vfsp->vfs_sync_task);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment