Fix for a deadlock triggered by a 'umount -f' causing a NFS request to never

retransmit (or return). Thanks to John Baldwin for helping nail this one.

Found by : Kris Kennaway
This commit is contained in:
Mohan Srinivasan 2006-08-29 22:00:12 +00:00
parent fa4a2ffd58
commit 6cd7078919

View File

@ -1372,8 +1372,20 @@ nfs_timer(void *arg)
if (rep->r_mrep || (rep->r_flags & R_SOFTTERM)) {
mtx_unlock(&rep->r_mtx);
continue;
} else
mtx_unlock(&rep->r_mtx);
} else {
/*
* Terminate request if force-unmount in progress.
* Note that NFS could have vfs_busy'ed the mount,
* causing the unmount to wait for the mnt_lock, making
* this bit of logic necessary.
*/
if (rep->r_nmp->nm_mountp->mnt_kern_flag & MNTK_UNMOUNTF) {
nfs_softterm(rep);
mtx_unlock(&rep->r_mtx);
continue;
}
mtx_unlock(&rep->r_mtx);
}
if (nfs_sigintr(nmp, rep, rep->r_td))
continue;
mtx_lock(&nmp->nm_mtx);