diff options
author | dfr <dfr@FreeBSD.org> | 2008-03-18 18:42:59 +0000 |
---|---|---|
committer | dfr <dfr@FreeBSD.org> | 2008-03-18 18:42:59 +0000 |
commit | f46620ae374ea61cbb68746c3da2ad4c05cf2258 (patch) | |
tree | 3dacc676fa3509eae81c2c5b126378e3557bed18 /sys | |
parent | a55b468d9cebdc6c48c23a5cae993eb6825ff9f4 (diff) | |
download | FreeBSD-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.c | 9 |
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; } } |