Re: NFS network locking broken (new schedule stuff)

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


shirsch@adelphia.net said:
> The NFS lock daemon is among the as-yet unrepaired casualties from
> the schedule() overhaul. Any attempt at obtaining a lock over NFS
> blows the server out of the water (endless scrolling error messages
> about bad value from timeout). Requires red-button reset.

Yeah - calling schedule_timeout() with a negative timeout now just returns,
whereas the equivalent before would schedule() anyway. lockd is looping in
this state, and hence never scheduling.

This patch fixes both - lockd will now set the timeout value to zero if it was
negative, and schedule_timeout() will schedule anyway.

Does anyone have fixes for the CVS ISDN tree yet? I think I'll leave our
router on 2.1.127-pre2 until they turn up.

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;
+ */
}
}

---- ---- ----
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.

-
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/