From nobody Fri Feb 04 13:31:18 2022 X-Original-To: dev-commits-src-main@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 52EFA19B2425; Fri, 4 Feb 2022 13:31:19 +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 4JqxJR1X5Wz3Pwf; Fri, 4 Feb 2022 13:31:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1643981479; 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=DJt/u4scfFF/mk2L8wX566ls7HmMn68KxcaXI4gFvLc=; b=JBcE1sBYZKx31IrLEUAdPSBoAtTkpRWs2l7YpjkJEPiVb7/acCqzFa/BOoRZjHWCckFJe5 CJ5PonyAz8lGDRiBqhkItHxI/p0iUXbG7RAbYQVhRIb6q0gHpPuJpaMpwcSQny3FQhrAC6 iDk6bUlWrmuUyQRQ2Dj62Vqe07KNO8cqgdVyroZBeSIPk8/k4CO9Mdh0Rkye5B1PzFnxre l8Ij/Q91Bv8ZYIYse6KLDCaH29Eow6QCBhkYP10CdSPjD0i5mAdbasgZQ7PprEKXk+xjGo K6qvFTPTGPQPMtS+d9qKwOJd6cm3GjChabt5QQPHgX7ijKITLLYwinCSt5ElyQ== 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 1385647A0; Fri, 4 Feb 2022 13:31:19 +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 214DVIvf082836; Fri, 4 Feb 2022 13:31:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 214DVIrA082835; Fri, 4 Feb 2022 13:31:18 GMT (envelope-from git) Date: Fri, 4 Feb 2022 13:31:18 GMT Message-Id: <202202041331.214DVIrA082835@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: 867b4decb4d5 - main - lindebugfs: Fix write List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 867b4decb4d50579152e52c594632cdc0f6266ff Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1643981479; 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=DJt/u4scfFF/mk2L8wX566ls7HmMn68KxcaXI4gFvLc=; b=XzFRctPZGa9K0hJrgrQhqcNTEHGSocJIZfincItkI+a40c2O1UFbBfK/DVmSPNe/zolbqY UYc3FKi9ovP5Z2ca/Yk8zHKzncu04C8xQ6r21kkv9cxpxLeGwlTemirbvWxuf8gE6ab7xb pH1+hJybl8v5Tz4OIKRFzD+oiTqY2cQfEk+Om+XFKQ8Cme2U1YhiRfBRRaTNSBzyFlGgA9 hA7K77TThFp24YVSWrB3/3lHdYFDzQEEKF8YS0tegt/5wNYrqhcSETDsnRCsFXMhEnwiJq 0BkIC0eUCNFCYLKzmGdHiSg3IlEGkgTuiC9Lycq2ZN6SNNTPIEMwcjyP5NW6zg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1643981479; a=rsa-sha256; cv=none; b=UYCmR2Dx2GVzznxaM6ZzhZJnaXEIl4vzXKbnyFRVzovoHkLBlpUdUSNSpuwPsBQ0pP2x52 Zi+Q99WSEH08YgTK7brMresugLude5+1liM2sAivB9Xi/jxqPm1bIy4JfYOvSV+/LAz03C mQHk7hkd2zPj91IT7TyouHMuNevlwvBwF26CrWsZMBccPoYizwsCLe4IY3VNJzyVaSuILD JYaJKibyxyzEHB5pzHk9qU1j/wD2bJUJGGvYfnA5U+TOIMuQYOk7lcbpZjzFdMONVIHWoy QkMIbs9j8bKhZ4odDexB78YQDs42i63SmnHcoblxmIyTOZ8LR/eGQjSs1X3ipw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=867b4decb4d50579152e52c594632cdc0f6266ff commit 867b4decb4d50579152e52c594632cdc0f6266ff Author: Emmanuel Vadot AuthorDate: 2022-01-31 13:46:16 +0000 Commit: Emmanuel Vadot CommitDate: 2022-02-04 13:31:08 +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 --- 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);