summaryrefslogtreecommitdiffstats
path: root/sys/nfs/nfs_socket.c
diff options
context:
space:
mode:
authorthib <thib@openbsd.org>2009-07-13 15:39:55 +0000
committerthib <thib@openbsd.org>2009-07-13 15:39:55 +0000
commitefdb5652767ca486e526f03f824e5fcb83a561cb (patch)
treee7d496118242181d3c8e8c0350b3c556ed0cd396 /sys/nfs/nfs_socket.c
parentdont initialise ifp->if_snd.ifq_maxlen, and then follow it by (diff)
downloadwireguard-openbsd-efdb5652767ca486e526f03f824e5fcb83a561cb.tar.xz
wireguard-openbsd-efdb5652767ca486e526f03f824e5fcb83a561cb.zip
Make the callers of nfs_request() responsible for freeing the reply mbuf,
if the reply is an error and retire the NFS_RETERR hack. For NFSv3 mounts the flag was set and reply mbuf not freed to allow the callers to handle the post-op attributes, or just free the mbuf for NFSv2. Tested by myself and jasper@ on various arch's. OK blambert@.
Diffstat (limited to 'sys/nfs/nfs_socket.c')
-rw-r--r--sys/nfs/nfs_socket.c21
1 files changed, 5 insertions, 16 deletions
diff --git a/sys/nfs/nfs_socket.c b/sys/nfs/nfs_socket.c
index 741848212af..d11135914a4 100644
--- a/sys/nfs/nfs_socket.c
+++ b/sys/nfs/nfs_socket.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_socket.c,v 1.85 2009/06/04 19:19:27 blambert Exp $ */
+/* $OpenBSD: nfs_socket.c,v 1.86 2009/07/13 15:39:55 thib Exp $ */
/* $NetBSD: nfs_socket.c,v 1.27 1996/04/15 20:20:00 thorpej Exp $ */
/*
@@ -1052,28 +1052,17 @@ tryagain:
*/
if (error == ESTALE)
cache_purge(rep->r_vp);
-
- if (nmp->nm_flag & NFSMNT_NFSV3 || error == ESTALE) {
- *mrp = mrep;
- *mdp = md;
- *dposp = dpos;
- error |= NFSERR_RETERR;
- } else
- m_freem(mrep);
- m_freem(rep->r_mreq);
- pool_put(&nfsreqpl, rep);
- return (error);
}
*mrp = mrep;
*mdp = md;
*dposp = dpos;
- m_freem(rep->r_mreq);
- pool_put(&nfsreqpl, rep);
- return (0);
+
+ goto nfsmout;
}
- m_freem(mrep);
+
error = EPROTONOSUPPORT;
+
nfsmout:
m_freem(rep->r_mreq);
pool_put(&nfsreqpl, rep);