From nobody Fri Oct 22 19:20:34 2021 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 3449E1804FBB; Fri, 22 Oct 2021 19:20:35 +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 4HbZ1v0sFCz4WRw; Fri, 22 Oct 2021 19:20:35 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 F2E641453E; Fri, 22 Oct 2021 19:20:34 +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 19MJKYgA080743; Fri, 22 Oct 2021 19:20:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19MJKY99080742; Fri, 22 Oct 2021 19:20:34 GMT (envelope-from git) Date: Fri, 22 Oct 2021 19:20:34 GMT Message-Id: <202110221920.19MJKY99080742@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 70f51f0e474f - main - Revert "Handle partial reads in zfs_read" 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: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 70f51f0e474ffe1fb74cb427423a2fba3637544d Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=70f51f0e474ffe1fb74cb427423a2fba3637544d commit 70f51f0e474ffe1fb74cb427423a2fba3637544d Author: Mark Johnston AuthorDate: 2021-10-22 18:55:14 +0000 Commit: Mark Johnston CommitDate: 2021-10-22 19:16:42 +0000 Revert "Handle partial reads in zfs_read" This reverts commit 59eab1093a361ca76849ca76b2ec079c8736e8e3. The change suppressed EFAULT originating from uiomove(). The deadlock avoidance mechanism implemented by vn_io_fault1() in the VFS handles such errors by wiring the user pages and retrying, but this change caused read() to return early instead. This can result in short I/O, causing misbehaviour in some applications, and possibly other consequences. Until this is resolved somehow, revert the commit. Approved by: mm --- sys/contrib/openzfs/module/zfs/zfs_vnops.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/sys/contrib/openzfs/module/zfs/zfs_vnops.c b/sys/contrib/openzfs/module/zfs/zfs_vnops.c index 9bd75c011ef9..8229bc9a93e5 100644 --- a/sys/contrib/openzfs/module/zfs/zfs_vnops.c +++ b/sys/contrib/openzfs/module/zfs/zfs_vnops.c @@ -254,7 +254,6 @@ zfs_read(struct znode *zp, zfs_uio_t *uio, int ioflag, cred_t *cr) } ASSERT(zfs_uio_offset(uio) < zp->z_size); - ssize_t start_offset = zfs_uio_offset(uio); ssize_t n = MIN(zfs_uio_resid(uio), zp->z_size - zfs_uio_offset(uio)); ssize_t start_resid = n; @@ -277,13 +276,6 @@ zfs_read(struct znode *zp, zfs_uio_t *uio, int ioflag, cred_t *cr) /* convert checksum errors into IO errors */ if (error == ECKSUM) error = SET_ERROR(EIO); - /* - * if we actually read some bytes, bubbling EFAULT - * up to become EAGAIN isn't what we want here. - */ - if (error == EFAULT && - (zfs_uio_offset(uio) - start_offset) != 0) - error = 0; break; }