summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authordfr <dfr@FreeBSD.org>2008-03-18 18:42:59 +0000
committerdfr <dfr@FreeBSD.org>2008-03-18 18:42:59 +0000
commitf46620ae374ea61cbb68746c3da2ad4c05cf2258 (patch)
tree3dacc676fa3509eae81c2c5b126378e3557bed18 /sys
parenta55b468d9cebdc6c48c23a5cae993eb6825ff9f4 (diff)
downloadFreeBSD-src-f46620ae374ea61cbb68746c3da2ad4c05cf2258.zip
FreeBSD-src-f46620ae374ea61cbb68746c3da2ad4c05cf2258.tar.gz
Don't call nfs_realign while holding locks.
Reviewed by: kib
Diffstat (limited to 'sys')
-rw-r--r--sys/nfsserver/nfs_srvsock.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/nfsserver/nfs_srvsock.c b/sys/nfsserver/nfs_srvsock.c
index 678191b..cb4c69e 100644
--- a/sys/nfsserver/nfs_srvsock.c
+++ b/sys/nfsserver/nfs_srvsock.c
@@ -651,15 +651,16 @@ nfsrv_getstream(struct nfssvc_sock *slp, int waitflag)
NFSD_UNLOCK();
rec = malloc(sizeof(struct nfsrv_rec), M_NFSRVDESC,
waitflag == M_DONTWAIT ? M_NOWAIT : M_WAITOK);
- NFSD_LOCK();
- if (!rec) {
- m_freem(slp->ns_frag);
- } else {
+ if (rec) {
nfs_realign(&slp->ns_frag, 10 * NFSX_UNSIGNED);
rec->nr_address = NULL;
rec->nr_packet = slp->ns_frag;
STAILQ_INSERT_TAIL(&slp->ns_rec, rec, nr_link);
}
+ NFSD_LOCK();
+ if (!rec) {
+ m_freem(slp->ns_frag);
+ }
slp->ns_frag = NULL;
}
}
OpenPOWER on IntegriCloud