Fix for a potential NFS client race where shared data is updated from
base context as well as the socket callback. Submitted by: Mohan Srinivasan
This commit is contained in:
parent
6ee20ab521
commit
7a5147540a
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=142070
@ -1027,10 +1027,12 @@ nfs_request(struct vnode *vp, struct mbuf *mrest, int procnum,
|
||||
error = nfs_send(nmp->nm_so, nmp->nm_nam, m2, rep);
|
||||
nfs_sndunlock(rep);
|
||||
}
|
||||
mtx_lock(&nfs_reqq_mtx);
|
||||
if (!error && (rep->r_flags & R_MUSTRESEND) == 0) {
|
||||
nmp->nm_sent += NFS_CWNDSCALE;
|
||||
rep->r_flags |= R_SENT;
|
||||
}
|
||||
mtx_unlock(&nfs_reqq_mtx);
|
||||
} else {
|
||||
splx(s);
|
||||
rep->r_rtt = -1;
|
||||
@ -1056,10 +1058,12 @@ nfs_request(struct vnode *vp, struct mbuf *mrest, int procnum,
|
||||
/*
|
||||
* Decrement the outstanding request count.
|
||||
*/
|
||||
mtx_lock(&nfs_reqq_mtx);
|
||||
if (rep->r_flags & R_SENT) {
|
||||
rep->r_flags &= ~R_SENT; /* paranoia */
|
||||
nmp->nm_sent -= NFS_CWNDSCALE;
|
||||
}
|
||||
mtx_unlock(&nfs_reqq_mtx);
|
||||
|
||||
/*
|
||||
* If there was a successful reply and a tprintf msg.
|
||||
|
Loading…
Reference in New Issue
Block a user