patch-1.3.36 linux/fs/nfs/rpcsock.c

Next file: linux/fs/open.c
Previous file: linux/fs/msdos/misc.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v1.3.35/linux/fs/nfs/rpcsock.c linux/fs/nfs/rpcsock.c
@@ -37,7 +37,7 @@
 #include <linux/rpcsock.h>
 
 #define msleep(sec)	{ current->timeout = sec * HZ / 1000; \
-			  current->state = TAKS_INTERRUPTIBLE; \
+			  current->state = TASK_INTERRUPTIBLE; \
 			  schedule(); \
 			}
 #define dprintk		if (0) printk
@@ -181,7 +181,6 @@
 	do {
 		/* We are not the receiver. Wait on the side lines. */
 		if (rsock->head != slot) {
-			slot->wait = NULL;
 			interruptible_sleep_on(&slot->wait);
 			if (slot->gotit)
 				break;
@@ -328,7 +327,7 @@
 		rsock->free = slot;
 
 		/* wake up tasks that haven't sent anything yet. (Waking
-		 * up the first one the wait queue would be enough) */
+		 * up the first one on the wait queue would be enough) */
 		if (rsock->backlog)
 			wake_up(&rsock->backlog);
 	}
@@ -349,6 +348,7 @@
 	dprintk("RPC: make RPC socket...\n");
 	if ((rsock = kmalloc(sizeof(struct rpc_sock), GFP_KERNEL)) == NULL)
 		return NULL;
+	memset(rsock, 0, sizeof(*rsock)); /* Nnnngh! */
 
 	rsock->sock = &file->f_inode->u.socket_i;
 	rsock->file = file;
@@ -358,11 +358,13 @@
 		slot->next = slot + 1;
 	slot->next = NULL;
 
+	/* --- taken care of by memset above ---
 	rsock->backlog = NULL;
 	rsock->head = rsock->tail = NULL;
 
 	rsock->shutwait = NULL;
 	rsock->shutdown = 0;
+	 */
 
 	dprintk("RPC: made socket %08lx", (long) rsock);
 	return rsock;
@@ -374,7 +376,7 @@
 	unsigned long	t0 = jiffies;
 
 	rsock->shutdown = 1;
-	while (rsock->head) {
+	while (rsock->head || rsock->backlog) {
 		interruptible_sleep_on(&rsock->shutwait);
 		if (current->signal & ~current->blocked)
 			return -EINTR;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this