Commit abd0cf7aeaaf8a15d9777e65606b6076868b6186

Authored by Nathan Scott
Committed by Christoph Hellwig
1 parent 764433b7f1

[XFS] Resolve an issue with xfsbufd not getting along with swsusp.

SGI Modid: xfs-linux:xfs-kern:22342a

Signed-off-by: Nathan Scott <nathans@sgi.com>
Signed-off-by: Christoph Hellwig <hch@sgi.com>

Showing 1 changed file with 9 additions and 2 deletions Side-by-side Diff

fs/xfs/linux-2.6/xfs_buf.c
... ... @@ -1746,13 +1746,15 @@
1746 1746 STATIC struct task_struct *pagebuf_daemon_task;
1747 1747 STATIC int pagebuf_daemon_active;
1748 1748 STATIC int force_flush;
  1749 +STATIC int force_sleep;
1749 1750  
1750   -
1751 1751 STATIC int
1752 1752 pagebuf_daemon_wakeup(
1753 1753 int priority,
1754 1754 unsigned int mask)
1755 1755 {
  1756 + if (force_sleep)
  1757 + return 0;
1756 1758 force_flush = 1;
1757 1759 barrier();
1758 1760 wake_up_process(pagebuf_daemon_task);
... ... @@ -1778,7 +1780,12 @@
1778 1780  
1779 1781 INIT_LIST_HEAD(&tmp);
1780 1782 do {
1781   - try_to_freeze(PF_FREEZE);
  1783 + if (unlikely(current->flags & PF_FREEZE)) {
  1784 + force_sleep = 1;
  1785 + refrigerator(PF_FREEZE);
  1786 + } else {
  1787 + force_sleep = 0;
  1788 + }
1782 1789  
1783 1790 set_current_state(TASK_INTERRUPTIBLE);
1784 1791 schedule_timeout((xfs_buf_timer_centisecs * HZ) / 100);