aboutsummaryrefslogtreecommitdiff
path: root/sys/fs
diff options
context:
space:
mode:
authorRick Macklem <rmacklem@FreeBSD.org>2022-03-28 22:11:52 +0000
committerRick Macklem <rmacklem@FreeBSD.org>2022-03-28 22:11:52 +0000
commitc1970a7ebab582d19694c9a525ed6eb4512fdb73 (patch)
tree398e883821fa054e6c76850f5df2b1598c90b3f3 /sys/fs
parentf5138631fb6f9dc73d696560caa006f3df714b9a (diff)
downloadsrc-c1970a7ebab582d19694c9a525ed6eb4512fdb73.tar.gz
src-c1970a7ebab582d19694c9a525ed6eb4512fdb73.zip
nfscl: Fix IO_APPEND writes from kernel space
Commit 867c27c23a5c modified the NFS client so that it did IO_APPEND writes directly to the NFS server bypassing the buffer cache, via a call to nfs_directio_write(). Unfortunately, this (very old) function assumed that the uio iov was for user space addresses. As such, a IO_APPEND VOP_WRITE() that was for system space, such as ktrace(1) does, would write bogus data. This patch fixes nfs_directio_write() so that it handles kernel space uio iovs. Reported by: bz Tested by: bz MFC after: 2 weeks
Diffstat (limited to 'sys/fs')
-rw-r--r--sys/fs/nfsclient/nfs_clbio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/fs/nfsclient/nfs_clbio.c b/sys/fs/nfsclient/nfs_clbio.c
index 00a3e5d12dd7..3103d87fc8af 100644
--- a/sys/fs/nfsclient/nfs_clbio.c
+++ b/sys/fs/nfsclient/nfs_clbio.c
@@ -780,7 +780,7 @@ do_sync:
uio.uio_iovcnt = 1;
uio.uio_offset = uiop->uio_offset;
uio.uio_resid = size;
- uio.uio_segflg = UIO_USERSPACE;
+ uio.uio_segflg = uiop->uio_segflg;
uio.uio_rw = UIO_WRITE;
uio.uio_td = td;
iomode = NFSWRITE_FILESYNC;