All of lore.kernel.org
 help / color / mirror / Atom feed
* File systems mounted "-o intr"
@ 2004-02-09 15:34 Olaf Kirch
  0 siblings, 0 replies; only message in thread
From: Olaf Kirch @ 2004-02-09 15:34 UTC (permalink / raw)
  To: nfs

[-- Attachment #1: Type: text/plain, Size: 449 bytes --]

Hi,

I noticed that Ctrl-C'ing out of an application hanging on a dead
NFS server doesn't work properly, even if mounted with -o intr.
Rather than bailing out instantly, the program doesn't receive
the SIGINT until the next timeout is reached.

The attached patch should fix this. Please let me know what you
think.

Olaf
-- 
Olaf Kirch     |  Stop wasting entropy - start using predictable
okir@suse.de   |  tempfile names today!
---------------+ 

[-- Attachment #2: nfs-interruptible --]
[-- Type: text/plain, Size: 1582 bytes --]

--- linux-2.6.2/net/sunrpc/sched.c.orig	2004-02-06 23:11:55.000000000 +0100
+++ linux-2.6.2/net/sunrpc/sched.c	2004-02-06 23:19:59.000000000 +0100
@@ -554,21 +554,28 @@
 			if (current->pid == rpciod_pid)
 				printk(KERN_ERR "RPC: rpciod waiting on sync task!\n");
 
-			__wait_event(task->tk_wait, !RPC_IS_SLEEPING(task));
-			dprintk("RPC: %4d sync task resuming\n", task->tk_pid);
-
-			/*
-			 * When a sync task receives a signal, it exits with
-			 * -ERESTARTSYS. In order to catch any callbacks that
-			 * clean up after sleeping on some queue, we don't
-			 * break the loop here, but go around once more.
-			 */
-			if (task->tk_client->cl_intr && signalled()) {
-				dprintk("RPC: %4d got signal\n", task->tk_pid);
-				task->tk_flags |= RPC_TASK_KILLED;
-				rpc_exit(task, -ERESTARTSYS);
-				rpc_wake_up_task(task);
+			if (!task->tk_client->cl_intr) {
+				__wait_event(task->tk_wait, !RPC_IS_SLEEPING(task));
+			} else {
+				__wait_event_interruptible(task->tk_wait,
+					       	!RPC_IS_SLEEPING(task), status);
+
+				/*
+				 * When a sync task receives a signal, it exits with
+				 * -ERESTARTSYS. In order to catch any callbacks that
+				 * clean up after sleeping on some queue, we don't
+				 * break the outer loop here, but go around once more.
+				 */
+				if (status == -ERESTARTSYS) {
+					dprintk("RPC: %4d got signal\n", task->tk_pid);
+					task->tk_flags |= RPC_TASK_KILLED;
+					rpc_exit(task, -ERESTARTSYS);
+					rpc_wake_up_task(task);
+					break;
+				}
 			}
+
+			dprintk("RPC: %4d sync task resuming\n", task->tk_pid);
 		}
 	}
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-02-10  0:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-02-09 15:34 File systems mounted "-o intr" Olaf Kirch

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.