2.1.127 knfs locking: "schedule_timeout: wrong timeout value fffac200"

David Woodhouse (David.Woodhouse@mvhi.com)
Sun, 08 Nov 1998 21:34:04 +0000


This is a multipart MIME message.

--==_Exmh_-11179899540
Content-Type: text/plain; charset=us-ascii

I took the opportunity of a quiet weekend to upgrade our server to use knfsd.
Unfortunately, I found that the timeout changes in 2.1.127 cause the machine to
lock up whenever I try to use file locking, which was the only reason I wanted
to upgrade anyway.

For some reason, the lockd code calls svc_recv with a timeout value less than
zero. The new schedule_timeout() just whinges and returns immediately, and the
lockd code loops for ever.

The attached patch fixes both lockd and schedule_timeout(). The former now
checks for a timeout value of less than zero, and the latter will schedule()
anyway.

Now I just have to work out why WindowMaker no longer works before they arrive
in the morning :)

--==_Exmh_-11179899540
Content-Type: text/plain; name="lockd-lockup-2.1.127"; charset=us-ascii
Content-Description: lockd-lockup-2.1.127
Content-Disposition: attachment; filename="lockd-lockup-2.1.127"

Index: fs/lockd/svc.c
===================================================================
RCS file: /cvs/linux/fs/lockd/svc.c,v
retrieving revision 1.1.1.4
diff -u -r1.1.1.4 svc.c
--- fs/lockd/svc.c 1998/11/04 20:00:07 1.1.1.4
+++ fs/lockd/svc.c 1998/11/08 20:26:50
@@ -139,6 +139,13 @@
} else if (nlmsvc_grace_period < jiffies)
nlmsvc_grace_period = 0;

+ /* Prevent a complete lockup of the machine which occurs
+ * if we give a negative timeout to svc_recv() and loop.
+ */
+
+ if (timeout < 0)
+ timeout = 0;
+
/*
* Find a socket with data available and call its
* recvfrom routine.
Index: kernel/sched.c
===================================================================
RCS file: /cvs/linux/kernel/sched.c,v
retrieving revision 1.1.1.16
diff -u -r1.1.1.16 sched.c
--- kernel/sched.c 1998/11/07 20:26:03 1.1.1.16
+++ kernel/sched.c 1998/11/08 20:26:55
@@ -491,7 +491,11 @@
printk(KERN_ERR "schedule_timeout: wrong timeout "
"value %lx from %p\n", timeout,
__builtin_return_address(0));
- goto out;
+ /*
+ * Don't quit (yet) as this breaks lockd
+ *
+ * // goto out;
+ */
}
}

--==_Exmh_-11179899540
Content-Type: text/plain; charset=us-ascii

---- ---- ----
David Woodhouse David.Woodhouse@mvhi.com Office: (+44) 1223 810302
Project Leader, Process Information Systems Mobile: (+44) 976 658355
Axiom (Cambridge) Ltd., Swaffham Bulbeck, Cambridge, CB5 0NA, UK.
finger dwmw2@ferret.lmh.ox.ac.uk for PGP key.

--==_Exmh_-11179899540--

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/