Fix a bunch of race cases in the NFS callout timer code, in the handling
authorMatthew Dillon <dillon@dragonflybsd.org>
Tue, 21 Feb 2006 04:47:56 +0000 (04:47 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Tue, 21 Feb 2006 04:47:56 +0000 (04:47 +0000)
commit91f46891a4a2d40e325e589958e801186d07a531
tree0e2043af4fee015099b56c8a1a7b8d40b1697476
parent9c06b29713f4dc04f1e8b076086fe7cfebacb84c
Fix a bunch of race cases in the NFS callout timer code, in the handling
of the NFS request queue and, in the handling of R_SENT.

The NFS stack can block in the callout timer code's request queue loop,
possibly resulting in another process ripping the current request in the
TAILQ_FOREACH scan out from under the loop.

R_MASKTIMER was being cleared too early, potentially allowing the callout
timer code to modify a request at the same time mainline code was working
on the same request synchronously.

The R_SENT bit would sometimes get set after the request had completed, or
get set twice, causing nmp->nm_sent to 'stick' and never return to 0.  This
in turn would stop the NFS retry code dead in its tracks and cause the NFS
mount to hang.

Reported-by: Stefan Krueger <skrueger@meinberlikomm.de>
Testing-by: Stefan Krueger <skrueger@meinberlikomm.de>
Also-thanks-to: Peter Holms filesystem and load testing suite (stress2).
sys/vfs/nfs/nfs.h
sys/vfs/nfs/nfs_nqlease.c
sys/vfs/nfs/nfs_socket.c