Commit ee9548d1 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] Fix suspend with NFS mounts active

From: Pavel Machek <pavel@ucw.cz>

This fixes suspend with NFS mounts active.
parent 2687d201
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#include <linux/sunrpc/svcsock.h> #include <linux/sunrpc/svcsock.h>
#include <linux/lockd/lockd.h> #include <linux/lockd/lockd.h>
#include <linux/nfs.h> #include <linux/nfs.h>
#include <linux/suspend.h>
#define NLMDBG_FACILITY NLMDBG_SVC #define NLMDBG_FACILITY NLMDBG_SVC
#define LOCKD_BUFSIZE (1024 + NLMSVC_XDRSIZE) #define LOCKD_BUFSIZE (1024 + NLMSVC_XDRSIZE)
...@@ -118,9 +119,11 @@ lockd(struct svc_rqst *rqstp) ...@@ -118,9 +119,11 @@ lockd(struct svc_rqst *rqstp)
* NFS mount or NFS daemon has gone away, and we've been sent a * NFS mount or NFS daemon has gone away, and we've been sent a
* signal, or else another process has taken over our job. * signal, or else another process has taken over our job.
*/ */
while ((nlmsvc_users || !signalled()) && nlmsvc_pid == current->pid) while ((nlmsvc_users || !signalled()) && nlmsvc_pid == current->pid) {
{
long timeout = MAX_SCHEDULE_TIMEOUT; long timeout = MAX_SCHEDULE_TIMEOUT;
if (current->flags & PF_FREEZE)
refrigerator(PF_IOTHREAD);
if (signalled()) { if (signalled()) {
flush_signals(current); flush_signals(current);
if (nlmsvc_ops) { if (nlmsvc_ops) {
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include <linux/smp.h> #include <linux/smp.h>
#include <linux/smp_lock.h> #include <linux/smp_lock.h>
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <linux/suspend.h>
#include <linux/sunrpc/clnt.h> #include <linux/sunrpc/clnt.h>
#include <linux/sunrpc/xprt.h> #include <linux/sunrpc/xprt.h>
...@@ -969,6 +970,8 @@ rpciod(void *ptr) ...@@ -969,6 +970,8 @@ rpciod(void *ptr)
flush_signals(current); flush_signals(current);
} }
__rpc_schedule(); __rpc_schedule();
if (current->flags & PF_FREEZE)
refrigerator(PF_IOTHREAD);
if (++rounds >= 64) { /* safeguard */ if (++rounds >= 64) { /* safeguard */
schedule(); schedule();
......
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