aboutsummaryrefslogtreecommitdiff
path: root/sys/nfsserver
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2009-12-03 20:59:28 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2009-12-03 20:59:28 +0000
commiteb27d7fb1cd34f79355b601588afbac239538809 (patch)
tree0b6b81a8fddc0b36f94e56dde929b5a43a30f219 /sys/nfsserver
parent9fbbaac0bbc10f6f0819b81fe3774c166a14f3b4 (diff)
downloadsrc-eb27d7fb1cd34f79355b601588afbac239538809.tar.gz
src-eb27d7fb1cd34f79355b601588afbac239538809.zip
Properly return an error reply if an NFS remove or link operation fails.
Previously the failing operation would allocate an mbuf and construct an error reply, but because the function did not return 0, the NFS server assumed it had failed to generate a reply and would leak the reply mbuf as well as not sending the reply to the NFS client. PR: kern/140853 Submitted by: Ted Faber faber at isi edu (remove) Reviewed by: rmacklem (remove) MFC after: 1 week
Notes
Notes: svn path=/head/; revision=200084
Diffstat (limited to 'sys/nfsserver')
-rw-r--r--sys/nfsserver/nfs_serv.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/nfsserver/nfs_serv.c b/sys/nfsserver/nfs_serv.c
index 3bb9a6a2880a..d1be5e55333d 100644
--- a/sys/nfsserver/nfs_serv.c
+++ b/sys/nfsserver/nfs_serv.c
@@ -1810,10 +1810,9 @@ out:
}
ereply:
nfsm_reply(NFSX_WCCDATA(v3));
- if (v3) {
+ if (v3)
nfsm_srvwcc_data(dirfor_ret, &dirfor, diraft_ret, &diraft);
- error = 0;
- }
+ error = 0;
nfsmout:
NDFREE(&nd, NDF_ONLY_PNBUF);
if (nd.ni_dvp) {
@@ -2187,8 +2186,8 @@ ereply:
if (v3) {
nfsm_srvpostop_attr(getret, &at);
nfsm_srvwcc_data(dirfor_ret, &dirfor, diraft_ret, &diraft);
- error = 0;
}
+ error = 0;
/* fall through */
nfsmout: