linux/fs/lockd
J. Bruce Fields c8ab5f2a13 lockd: don't depend on lockd main loop to end grace
End lockd's grace period using schedule_delayed_work() instead of a
check on every pass through the main loop.

After a later patch, we'll depend on lockd to end its grace period even
if it's not currently handling requests; so it shouldn't depend on being
woken up from the main loop to do so.

Also, Nakano Hiroaki (who independently produced a similar patch)
noticed that the current behavior is buggy in the face of jiffies
wraparound:

	"lockd uses time_before() to determine whether the grace period
	has expired. This would seem to be enough to avoid timer
	wrap-around issues, but, unfortunately, that is not the case.
	The time_* family of comparison functions can be safely used to
	compare jiffies relatively close in time, but they stop working
	after approximately LONG_MAX/2 ticks. nfsd can suffer this
	problem because the time_before() comparison in lockd() is not
	performed until the first request comes in, which means that if
	there is no lockd traffic for more than LONG_MAX/2 ticks we are
	screwed.

	"The implication of this is that once time_before() starts
	misbehaving any attempt from a NFS client to execute fcntl()
	will be received with a NLM_LCK_DENIED_GRACE_PERIOD message for
	25 days (assuming HZ=1000). In other words, the 50 seconds grace
	period could turn into a grace period of 50 days or more.

	"Note: This bug was analyzed independently by Oda-san
	<oda@valinux.co.jp> and myself."

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Cc: Nakano Hiroaki <nakano.hiroaki@oss.ntt.co.jp>
Cc: Itsuro Oda <oda@valinux.co.jp>
2008-09-29 18:13:10 -04:00
..
Makefile Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
clntlock.c NLM: Introduce an arguments structure for nlmclnt_init() 2008-01-30 02:06:07 -05:00
clntproc.c lockd: dont return EAGAIN for a permanent error 2008-07-25 10:53:47 -07:00
host.c Merge git://git.linux-nfs.org/projects/trondmy/nfs-2.6 2008-04-24 11:46:16 -07:00
mon.c lockd: introduce new function to encode private argument in SM_MON requests 2008-03-19 18:01:10 -04:00
svc.c lockd: don't depend on lockd main loop to end grace 2008-09-29 18:13:10 -04:00
svc4proc.c lockd: trivial sparse endian annotations 2008-07-23 07:38:04 -04:00
svclock.c locks: add special return value for asynchronous locks 2008-07-25 10:53:47 -07:00
svcproc.c lockd: trivial sparse endian annotations 2008-07-23 07:38:04 -04:00
svcshare.c lockd: fix sparse warning in svcshare.c 2008-04-23 16:13:39 -04:00
svcsubs.c lockd: Pass "struct sockaddr *" to new failover-by-IP function 2008-07-15 16:11:29 -04:00
xdr.c lockd: Eliminate harmless mixed sign comparison in nlmdbg_cookie2a() 2008-01-30 02:06:02 -05:00
xdr4.c LOCKD: Convert printk's to dprintk's in lockd XDR routines 2007-10-09 17:17:12 -04:00