Skip to contentSkip to conversation

Fix suspend with NFS mounts active

PATCH Pavel Machek 1 participant 1 message Jun 18, 2003 Kbuild

lore
Share & tools
lore
#0 lore raw

Hi!

This fixes suspend with NFS mounts active. Please apply,

Pavel

usr/src/linux/fs/lockd/svc.c renamed from usr/src/tmp/linux/fs/lockd/svc.c +5 -2
@@ -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 @@
 	 * 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) {
usr/src/linux/net/sunrpc/sched.c renamed from usr/src/tmp/linux/net/sunrpc/sched.c +3 -0
@@ -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 @@
 			flush_signals(current);
 		}
 		__rpc_schedule();
+                if (current->flags & PF_FREEZE)
+                        refrigerator(PF_IOTHREAD);
 
 		if (++rounds >= 64) {	/* safeguard */
 			schedule();
Signature · 2 lines
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]