From nobody Sat Mar 05 11:34:14 2022 X-Original-To: dev-commits-src-branches@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 DEE2F1A07F6D; Sat, 5 Mar 2022 11:34:14 +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 4K9jKy5wGxz3rtF; Sat, 5 Mar 2022 11:34:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1646480054; 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=LRsxr4g0ZGotx1PAjsMe7WvEpXeJTm+/O0P0BRneAGo=; b=MlJ/i0ZbObPIx+0BL0QPOiJcMzgKMKVWB3ASCYz4yEqToy7tiS2JcQ3czV0zZeuQ7y4iFj E4xofZ4NYueMdSUU2uNuBtQgxvkhLkcm7crRqLZeU0g3GySjBsKjSIjZXNJzpVhWm0eVCj vCttI84P2yjMxHNanChWNGiIK2+HPmK8fLIdksDrcTSSY1L4nVVb/nBehr3spz1qQz9w3P zv2IElpxf54PTuesXDvxmismKXnOPOhhP0IHhu+ihoxIyr9Smj2xU0IPXLvquZ3JK7IbXt bqvIX6zJTYDbUGnVWvFzodKkSyBV6zjIuLL2cOM09Ry9iDZY4wkm8YIqVvvpDQ== 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 AB25C1F779; Sat, 5 Mar 2022 11:34:14 +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 225BYEeJ046467; Sat, 5 Mar 2022 11:34:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 225BYEJN046466; Sat, 5 Mar 2022 11:34:14 GMT (envelope-from git) Date: Sat, 5 Mar 2022 11:34:14 GMT Message-Id: <202203051134.225BYEJN046466@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Emmanuel Vadot Subject: git: 5145a7927845 - stable/13 - lindebugfs: Fix write List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5145a7927845688e34d597b4312a13ac66817b26 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1646480054; 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=LRsxr4g0ZGotx1PAjsMe7WvEpXeJTm+/O0P0BRneAGo=; b=vBzGps9Utt3mWlrdfoGbIIRaxfe1rgOofljKtXnv6/0wFesWWr7hzxaOi3D57Tr+KfwMhX hAjBG9txxzGiB6ZbFxSzoIYSHXAkcfItVMEX9Ewo5u5yqX59l3yf/uFD7poADoFRWjjQ8t cw/WMndpwiyCVgbaxkRpNJIrnHLHzfIh1ibEM8j3Q/Hw5qbd0YLWhhgXpYhMzc2eZ3A59h s6KvSXrAFDZlxATOU/WVSc4crSyU9CDz9ndEalFjXLnpE7qCLgFP/ycyAPYTZ97ZyFUSPT aDP5ly0dGX/y9eVZjvqCbZ4vhAIquEtFBUsL3r9+XmN3Wl2jWeo5isOQeuguog== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1646480054; a=rsa-sha256; cv=none; b=mG6DIvQBuK9RdSpGNeLkQRW7RlDwmtJhIhX4OSF1rlboPEWEQ10ogImuRxUakMKxC42nmx mnx9WevZU3xVlfShLr5+lsM9tMwjlrcsvBXnyQ+34YytMw5uG0B75HVehphl0tGnVfzAVd cyVeYyvmZzLIv4IiYzD7uXvHw4LVPCAi3ejT+EHtkUR5H8wYUTdWoS2jxJG5tmSRfCJuLC kIuwdPlchyW1lSz7p81AJD1AG+Xc/UdWHI/s8LQlnglJpIkuNbu/4MfFENJ57721nDAV6e cB5yg/xLGge5hb0D900zhriq02wtLVpJDFI38lvF06sTXZaEd2vAIt1vjhv0tQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=5145a7927845688e34d597b4312a13ac66817b26 commit 5145a7927845688e34d597b4312a13ac66817b26 Author: Emmanuel Vadot AuthorDate: 2022-01-31 13:46:16 +0000 Commit: Emmanuel Vadot CommitDate: 2022-03-05 11:12:43 +0000 lindebugfs: Fix write For write operation pseudofs creates an sbuf with the data. Use this data instead of the uio as it's not usable anymore after uiomove. Reviewed by: hselasky MFC after: 1 week Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D34114 (cherry picked from commit 867b4decb4d50579152e52c594632cdc0f6266ff) --- sys/compat/lindebugfs/lindebugfs.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sys/compat/lindebugfs/lindebugfs.c b/sys/compat/lindebugfs/lindebugfs.c index 63161eedf14f..8eaa41412fd2 100644 --- a/sys/compat/lindebugfs/lindebugfs.c +++ b/sys/compat/lindebugfs/lindebugfs.c @@ -130,8 +130,14 @@ debugfs_fill(PFS_FILL_ARGS) if ((rc = linux_set_current_flags(curthread, M_NOWAIT))) return (rc); vn.v_data = d->dm_data; - buf = uio->uio_iov[0].iov_base; - len = min(uio->uio_iov[0].iov_len, uio->uio_resid); + if (uio->uio_rw == UIO_READ) { + buf = uio->uio_iov[0].iov_base; + len = min(uio->uio_iov[0].iov_len, uio->uio_resid); + } else { + sbuf_finish(sb); + buf = sbuf_data(sb); + len = sbuf_len(sb); + } off = 0; lf.private_data = NULL; rc = d->dm_fops->open(&vn, &lf);