From nobody Wed Jun 22 00:56:00 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 61C5E85EB46; Wed, 22 Jun 2022 00:56:00 +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 4LSQ1D2Jggz4Wy3; Wed, 22 Jun 2022 00:56:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1655859360; 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=ZvgeQfzQgLf6+43ckiRyLeayVB3AhITs7ij5i7gA8zU=; b=kaADq9g0nuZZmDWf79KHqBkuC/gPrRgQdJwO543Qn5bxZ6I6efOFV9oCCtAo8Xsmiu+S4G BcF+8HknTS7I9/kf4piwxFJ8jD7Lm3ruvjei6SA99P2n3N3BNSw5rrmYo7DOeov9FkdQuS mjUdLy5IXwXfekCqrm2Yhds1tAYpkTt6yPOdojS3AxwG0coHq33woTO4UQo857EOQTTA8F GGJ4QsskyMP5oFpe/+c+A36i7SqcX4klCfLmVBADFxPn3M+us8NiJnbaK225dnSi8GWdRi jYZdb9bR7kGd7j3j3Z1p5mq4Wnn6nkr0Zgu0zMdHwIYWjeFLDeESxH0BVWLSCA== 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 2FC3B1C357; Wed, 22 Jun 2022 00:56:00 +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 25M0u0bt041936; Wed, 22 Jun 2022 00:56:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 25M0u0dI041935; Wed, 22 Jun 2022 00:56:00 GMT (envelope-from git) Date: Wed, 22 Jun 2022 00:56:00 GMT Message-Id: <202206220056.25M0u0dI041935@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Chuck Silvers Subject: git: 82817f26f8ec - main - ffs: fix vn_io_fault_pgmove() offset for PAGE_SIZE > block size 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: chs X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 82817f26f8ecf5a3c43a8ad51737731a9b9764de Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1655859360; 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=ZvgeQfzQgLf6+43ckiRyLeayVB3AhITs7ij5i7gA8zU=; b=kGq2JxaJd5O/fXf5T3P4ouQBOjunKYbZHPiIBWofbQhWMnNbZXlc7I4IT9T/bGMatGAYSU kTm8E0wP0lFeo14SWzEA66D2xF8fFuDMHStOMJGDQ7mMA/ybgm6Lnv+ePMjMnj79e8Hrms QA4SGFX6jEwP2aoIOY9uEXqK8ObO43HGMwlAHUa1Wc3TNNrA3txHMC/A0NkVC2AhAMXrU1 lsjz2InlGJre9uIP3m4LpDtsboRM9hDpQS6Gv6lbR9xDwoORMTxS0mq9IGXkh/prFR1Wi/ 3fpK/ndsjoHY52GG4ac4nxCzVF2FOY9SdOGgEViGCTXYawsXq+FwTkXHUCmzOw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1655859360; a=rsa-sha256; cv=none; b=EdmL0Oe7iZQ7/oZmL/yUOm9+OrU10e1RZmPp2vk/OZcNO8EwsJsWRlTVW96NS84wKb3F0N vB+VY4JUbwR7yPVfVii1lKIfQc4uw9aPJdL0VLt8jGrai5LuuzAvE+p4nYVLn7EpF9jW4P 6fnkeHNUomv2EQs5D4CxxCqdlldW0IKM6GG4TRAflbKYaKYUVeAZikDRQWuPbwEy3Jtkp5 zgxsduuHyNzj/A/1oE/ga7qKMPQD2QgHLU8GlteK3BZ6Qy6DfuWG0xLDjE+frK60AFNNEa lEmCtgadzwhuRcPQ6rSOxZG+YHYG0RaBxRTEXCvbAszPq6Gi9VJwMcISUpZt1Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by chs: URL: https://cgit.FreeBSD.org/src/commit/?id=82817f26f8ecf5a3c43a8ad51737731a9b9764de commit 82817f26f8ecf5a3c43a8ad51737731a9b9764de Author: Chuck Silvers AuthorDate: 2022-06-22 00:54:18 +0000 Commit: Chuck Silvers CommitDate: 2022-06-22 00:54:18 +0000 ffs: fix vn_io_fault_pgmove() offset for PAGE_SIZE > block size The "offset" argument to vn_io_fault_pgmove() is supposed to be the offset within the page, but for ffs we currently use the offset within the block. When the block size is at least as large as the page size then these values are the same, but when the page size is larger than the block size then we need to add the offset of the block within the page as well. Sponsored by: Netflix Reviewed by: mckusick, kib, markj Differential Revision: https://reviews.freebsd.org/D34835 --- sys/ufs/ffs/ffs_vnops.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c index b57e9a3a71b0..c3f63bbfc44f 100644 --- a/sys/ufs/ffs/ffs_vnops.c +++ b/sys/ufs/ffs/ffs_vnops.c @@ -795,7 +795,8 @@ ffs_read(ap) error = vn_io_fault_uiomove((char *)bp->b_data + blkoffset, (int)xfersize, uio); } else { - error = vn_io_fault_pgmove(bp->b_pages, blkoffset, + error = vn_io_fault_pgmove(bp->b_pages, + blkoffset + (bp->b_offset & PAGE_MASK), (int)xfersize, uio); } if (error) @@ -947,7 +948,8 @@ ffs_write(ap) error = vn_io_fault_uiomove((char *)bp->b_data + blkoffset, (int)xfersize, uio); } else { - error = vn_io_fault_pgmove(bp->b_pages, blkoffset, + error = vn_io_fault_pgmove(bp->b_pages, + blkoffset + (bp->b_offset & PAGE_MASK), (int)xfersize, uio); } /*