diff options
author | iedowse <iedowse@FreeBSD.org> | 2002-01-10 02:15:35 +0000 |
---|---|---|
committer | iedowse <iedowse@FreeBSD.org> | 2002-01-10 02:15:35 +0000 |
commit | 2d507f0adf63fb1f2fe94079fc6c9a701218999d (patch) | |
tree | 2b3c403cf1a32190997ea7f12250026847743fa8 /sys | |
parent | 83b07d10e7c28afeb6242eaeb47da951e9bbc295 (diff) | |
download | FreeBSD-src-2d507f0adf63fb1f2fe94079fc6c9a701218999d.zip FreeBSD-src-2d507f0adf63fb1f2fe94079fc6c9a701218999d.tar.gz |
Terminate requests in nfs_sigintr() if the filesystem is in the
process of being unmounted. This allows forced NFS unmounts to
complete even if there are processes stuck holding the mnt_lock
while the server is down. The mechanism is not ideal in that there
is a small chance we might accidentally cancel requests during a
failed non-forced unmount attempt on that filesystem, but this
is not really a big problem.
Also, move the tsleep() in nfs_nmcancelreqs() so that we do not
sleep in the case where there are no requests to be cancelled.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/nfsclient/nfs_socket.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/nfsclient/nfs_socket.c b/sys/nfsclient/nfs_socket.c index 858b14e..22ca4ce 100644 --- a/sys/nfsclient/nfs_socket.c +++ b/sys/nfsclient/nfs_socket.c @@ -1188,7 +1188,6 @@ nfs_nmcancelreqs(nmp) splx(s); for (i = 0; i < 30; i++) { - tsleep(&lbolt, PSOCK, "nfscancel", 0); s = splnet(); TAILQ_FOREACH(req, &nfs_reqq, r_chain) { if (nmp == req->r_nmp) @@ -1197,6 +1196,7 @@ nfs_nmcancelreqs(nmp) splx(s); if (req == NULL) return (0); + tsleep(&lbolt, PSOCK, "nfscancel", 0); } return (EBUSY); } @@ -1229,6 +1229,9 @@ nfs_sigintr(struct nfsmount *nmp, struct nfsreq *rep, struct proc *p) if (rep && (rep->r_flags & R_SOFTTERM)) return (EINTR); + /* Terminate all requests while attempting to unmount. */ + if (nmp->nm_mountp->mnt_kern_flag & MNTK_UNMOUNT) + return (EINTR); if (!(nmp->nm_flag & NFSMNT_INT)) return (0); if (p == NULL) |