FreeBSD Bugzilla – Attachment 6731 Details for
Bug 15055
Soft NFS mounts can deadlock
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 1.97 KB, created by
iedowse
on 1999-11-23 03:00:01 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
iedowse
Created:
1999-11-23 03:00:01 UTC
Size:
1.97 KB
patch
obsolete
>--- nfs_socket.c.orig Mon Nov 22 21:58:12 1999 >+++ nfs_socket.c Mon Nov 22 22:43:33 1999 >@@ -152,6 +152,7 @@ > static void nfs_realign __P((struct mbuf **pm, int hsiz)); > static int nfs_receive __P((struct nfsreq *rep, struct sockaddr **aname, > struct mbuf **mp)); >+static void nfs_softterm __P((struct nfsreq *rep)); > static int nfs_reconnect __P((struct nfsreq *rep)); > #ifndef NFS_NOSERVER > static int nfsrv_getstream __P((struct nfssvc_sock *,int)); >@@ -864,8 +865,10 @@ > if (nmp->nm_cwnd > NFS_MAXCWND) > nmp->nm_cwnd = NFS_MAXCWND; > } >- rep->r_flags &= ~R_SENT; >- nmp->nm_sent -= NFS_CWNDSCALE; >+ if (rep->r_flags & R_SENT) { >+ rep->r_flags &= ~R_SENT; >+ nmp->nm_sent -= NFS_CWNDSCALE; >+ } > /* > * Update rtt using a gain of 0.125 on the mean > * and a gain of 0.25 on the deviation. >@@ -1384,7 +1387,7 @@ > if (rep->r_mrep || (rep->r_flags & R_SOFTTERM)) > continue; > if (nfs_sigintr(nmp, rep, rep->r_procp)) { >- rep->r_flags |= R_SOFTTERM; >+ nfs_softterm(rep); > continue; > } > if (rep->r_rtt >= 0) { >@@ -1412,7 +1415,7 @@ > } > if (rep->r_rexmit >= rep->r_retry) { /* too many */ > nfsstats.rpctimeouts++; >- rep->r_flags |= R_SOFTTERM; >+ nfs_softterm(rep); > continue; > } > if (nmp->nm_sotype != SOCK_DGRAM) { >@@ -1491,6 +1494,27 @@ > nfs_timer_handle = timeout(nfs_timer, (void *)0, nfs_ticks); > } > >+/* >+ * Flag a request as being about to terminate (due to NFSMNT_INT/NFSMNT_SOFT). >+ * The nm_send count is decremented now to avoid deadlocks when the process in >+ * soreceive() hasn't yet managed to send its own request. >+ */ >+static void >+nfs_softterm(rep) >+ struct nfsreq *rep; >+{ >+ rep->r_flags |= R_SOFTTERM; >+ >+ /* >+ * Decrement the outstanding request count, and clear R_SENT so >+ * that the decrement doesn't get done again later. >+ */ >+ if (rep->r_flags & R_SENT) { >+ rep->r_nmp->nm_sent -= NFS_CWNDSCALE; >+ rep->r_flags &= ~R_SENT; >+ } >+} >+ > > /* > * Test for a termination condition pending on the process.
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 15055
: 6731