summaryrefslogtreecommitdiffstats
path: root/sys/nfsclient
diff options
context:
space:
mode:
authorrmacklem <rmacklem@FreeBSD.org>2013-07-01 21:16:19 +0000
committerrmacklem <rmacklem@FreeBSD.org>2013-07-01 21:16:19 +0000
commit305e9da8a6c43e754f9ca6030f2283be11dae949 (patch)
tree829aa43623a4fa904e812b0cefb561bc91f06e26 /sys/nfsclient
parentcba9c47f36f317e465c63692c251172caa251136 (diff)
downloadFreeBSD-src-305e9da8a6c43e754f9ca6030f2283be11dae949.zip
FreeBSD-src-305e9da8a6c43e754f9ca6030f2283be11dae949.tar.gz
A recent version of the oldnfs NFS client in head/current
will crash when doing a large write, since m_get2() would return NULL. This patch fixes the problem, since nfsm_uiotombuf() will allocate additional mbufs, as required. Reported by: sbruno Tested by: sbruno Discussed with: glebius
Diffstat (limited to 'sys/nfsclient')
-rw-r--r--sys/nfsclient/nfs_vnops.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/nfsclient/nfs_vnops.c b/sys/nfsclient/nfs_vnops.c
index d834b89..69ff21d 100644
--- a/sys/nfsclient/nfs_vnops.c
+++ b/sys/nfsclient/nfs_vnops.c
@@ -1379,8 +1379,8 @@ nfs_writerpc(struct vnode *vp, struct uio *uiop, struct ucred *cred,
while (tsiz > 0) {
nfsstats.rpccnt[NFSPROC_WRITE]++;
len = (tsiz > wsize) ? wsize : tsiz;
- mreq = m_get2(NFSX_FH(v3) + 5 * NFSX_UNSIGNED + nfsm_rndup(len),
- M_WAITOK, MT_DATA, 0);
+ mreq = m_get2(NFSX_FH(v3) + 5 * NFSX_UNSIGNED, M_WAITOK,
+ MT_DATA, 0);
mb = mreq;
bpos = mtod(mb, caddr_t);
nfsm_fhtom(vp, v3);
OpenPOWER on IntegriCloud