From: Pavel Machek <pavel@ucw.cz>

This fixes suspend with NFS mounts active.



 fs/lockd/svc.c     |    7 +++++--
 net/sunrpc/sched.c |    3 +++
 2 files changed, 8 insertions(+), 2 deletions(-)

diff -puN fs/lockd/svc.c~nfs-suspend-fix fs/lockd/svc.c
--- 25/fs/lockd/svc.c~nfs-suspend-fix	2003-06-18 09:38:04.000000000 -0700
+++ 25-akpm/fs/lockd/svc.c	2003-06-18 09:38:04.000000000 -0700
@@ -34,6 +34,7 @@
 #include <linux/sunrpc/svcsock.h>
 #include <linux/lockd/lockd.h>
 #include <linux/nfs.h>
+#include <linux/suspend.h>
 
 #define NLMDBG_FACILITY		NLMDBG_SVC
 #define LOCKD_BUFSIZE		(1024 + NLMSVC_XDRSIZE)
@@ -118,9 +119,11 @@ lockd(struct svc_rqst *rqstp)
 	 * NFS mount or NFS daemon has gone away, and we've been sent a
 	 * 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;
+
+		if (current->flags & PF_FREEZE)
+			refrigerator(PF_IOTHREAD);
 		if (signalled()) {
 			flush_signals(current);
 			if (nlmsvc_ops) {
diff -puN net/sunrpc/sched.c~nfs-suspend-fix net/sunrpc/sched.c
--- 25/net/sunrpc/sched.c~nfs-suspend-fix	2003-06-18 09:38:04.000000000 -0700
+++ 25-akpm/net/sunrpc/sched.c	2003-06-18 09:38:04.000000000 -0700
@@ -20,6 +20,7 @@
 #include <linux/smp.h>
 #include <linux/smp_lock.h>
 #include <linux/spinlock.h>
+#include <linux/suspend.h>
 
 #include <linux/sunrpc/clnt.h>
 #include <linux/sunrpc/xprt.h>
@@ -969,6 +970,8 @@ rpciod(void *ptr)
 			flush_signals(current);
 		}
 		__rpc_schedule();
+		if (current->flags & PF_FREEZE)
+			refrigerator(PF_IOTHREAD);
 
 		if (++rounds >= 64) {	/* safeguard */
 			schedule();

_