From nobody Mon Jun 06 22:12:36 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 58BB31BEED75; Mon, 6 Jun 2022 22:12:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LH75c1wCSz3q1Y; Mon, 6 Jun 2022 22:12:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1654553556; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TT55lK4F3WMLfqqG4/geAoag0at8WvpN3mRaidxgkp4=; b=M8XzxipxQKlEsed/WpviUaECCk4yXaeEJGIou/EGgTsdDJl1QhfI2tGyAVqvJru0Mokg0k tp5Q3lZlYSTr8Zq1XuM4WN+59WlGHSSwM1LeWMiJe4kiHIz0ip7HLVcDa5XtIDrkUVzGDa PK3GRaoegNjv/uXoKtKWRzS9B/NLb94/XOJkbXehLSZFQG9PctE718CgV53MkmOsp9XaKg EbHBteqQNC/yAiz/KifmIElPE3wm3wVkEXDyCc6u1uXW93qwYzVpr7/2yn7PF6rOw1c47/ epWZOgOIn25uGjfJ9zzui1333QwbAyc/i2E8l04+dxtuanEgvwKMOBJR5RSLXQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 214FF69B7; Mon, 6 Jun 2022 22:12:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 256MCauG008123; Mon, 6 Jun 2022 22:12:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 256MCaAn008122; Mon, 6 Jun 2022 22:12:36 GMT (envelope-from git) Date: Mon, 6 Jun 2022 22:12:36 GMT Message-Id: <202206062212.256MCaAn008122@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 3ac3f94992ed - stable/13 - nfscl: Fix IO_APPEND writes from kernel space List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 3ac3f94992ed936a380bedc6ca2e0759c9abe909 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1654553556; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TT55lK4F3WMLfqqG4/geAoag0at8WvpN3mRaidxgkp4=; b=uXuMe9XmN/+Z6DZUWQh9T14T/WXExlvskU9AhTeFpxY6QZYgZb7TdDk1eVYWObFVJ1OsrI zsUTZfTCEYJqHAEcaVWW8pTb4w9sVB99wYbZNuEcU80FXwtXyK2BSq+8VV/xKYMt0zuBy7 X8PIrX47ouvY8Arm3JeyqCEwDUtUVlhz+iNujnSzNTnk0jT7kQntjE9mD1ucfaoRHbowVl YOfJD9IR7CGGAlSYyQvLvOvliKi5NvVbxA3DAkn6DpSvD7jgEhBbijmeECOCSDE7biYWfU bH2XA2IPx4b8dMBIAXIdqsq0GzyGRAqvng923E5v65fA+ngQ0IY0/xsuBqPi/A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1654553556; a=rsa-sha256; cv=none; b=UHrFdWvwwquq9I9dO9ZeDv6vT5WhpskQgJSQadExxMRoBTlcqiSUHllLRUbjAsk2PJNVGU Cxw6a7ULLXjVIR6dw4WG9bi0Qqdt39jTcJGoTCn9uHEKkYvBb2V+SgaRUxKB4f626CnJWp B60EivZ0eSfdWZ8wXqpnmZRrXwED2waZ9s2x1JXgjGJm+2vjI3bPXl3/bQZKOeZm2zMJRM 97+18mIPhnFqjdmwKDfi8uo8sXObYoq5eSUBCamF2rTl+YL97R63XgmN/UDxj9eU6z7kHt rP48J0We1NrPIl/V1u+7tVTnhcoBmzg6KhLuFwN6vpnmwoDiLXBhmH5bXmFaSw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=3ac3f94992ed936a380bedc6ca2e0759c9abe909 commit 3ac3f94992ed936a380bedc6ca2e0759c9abe909 Author: Rick Macklem AuthorDate: 2022-03-28 22:11:52 +0000 Commit: Rick Macklem CommitDate: 2022-06-06 22:11:37 +0000 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. (cherry picked from commit c1970a7ebab582d19694c9a525ed6eb4512fdb73) --- sys/fs/nfsclient/nfs_clbio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/fs/nfsclient/nfs_clbio.c b/sys/fs/nfsclient/nfs_clbio.c index 29bc66669dfb..7f661e36f4b7 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;