diff options
author | ps <ps@FreeBSD.org> | 2005-11-03 07:31:06 +0000 |
---|---|---|
committer | ps <ps@FreeBSD.org> | 2005-11-03 07:31:06 +0000 |
commit | 65fc4c8f22ed2c93342ce5a8c848a549e4d94864 (patch) | |
tree | 55ee2b845c9fb1a1201e4df1fc5c805b5a7b1e2e /sys | |
parent | bef9291595739a3894e68ec9bc7559968db43217 (diff) | |
download | FreeBSD-src-65fc4c8f22ed2c93342ce5a8c848a549e4d94864.zip FreeBSD-src-65fc4c8f22ed2c93342ce5a8c848a549e4d94864.tar.gz |
Fix for a race between the thread transmitting the request and the
thread processing the reply.
Submitted by: Mohan Srinivasan
Diffstat (limited to 'sys')
-rw-r--r-- | sys/nfsclient/nfs_socket.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/nfsclient/nfs_socket.c b/sys/nfsclient/nfs_socket.c index 6683497..9e7a386 100644 --- a/sys/nfsclient/nfs_socket.c +++ b/sys/nfsclient/nfs_socket.c @@ -1011,7 +1011,11 @@ tryagain: nfs_sndunlock(rep); } mtx_lock(&nfs_reqq_mtx); - if (!error && (rep->r_flags & R_MUSTRESEND) == 0) { + /* + * nfs_timer() could've re-transmitted the request if we ended up + * blocking on nfs_send() too long, so check for R_SENT here. + */ + if (!error && (rep->r_flags & (R_SENT | R_MUSTRESEND)) == 0) { nmp->nm_sent += NFS_CWNDSCALE; rep->r_flags |= R_SENT; } |