From owner-svn-src-head@freebsd.org Thu Feb 20 01:33:02 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5788424BC9C; Thu, 20 Feb 2020 01:33:02 +0000 (UTC) (envelope-from imp@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) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48NHCf1bH7z3N3R; Thu, 20 Feb 2020 01:33:02 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EA37E19FE1; Thu, 20 Feb 2020 01:33:01 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 01K1X10w092259; Thu, 20 Feb 2020 01:33:01 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 01K1X1wC092258; Thu, 20 Feb 2020 01:33:01 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202002200133.01K1X1wC092258@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 20 Feb 2020 01:33:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r358143 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 358143 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Feb 2020 01:33:02 -0000 Author: imp Date: Thu Feb 20 01:33:01 2020 New Revision: 358143 URL: https://svnweb.freebsd.org/changeset/base/358143 Log: Don't convert all lower-layer errors to EIO. Don't convert all lower layer errors to EIO. Instead, pass the actual error up the stack. This will allow the upper layers that look for ENXIO to react properly to that signal from the lower layers and, for UFS, unmount the filesystem. Reviewed by: kib@ Differential Revision: https://reviews.freebsd.org/D23755 Modified: head/sys/vm/vnode_pager.c Modified: head/sys/vm/vnode_pager.c ============================================================================== --- head/sys/vm/vnode_pager.c Thu Feb 20 01:27:35 2020 (r358142) +++ head/sys/vm/vnode_pager.c Thu Feb 20 01:33:01 2020 (r358143) @@ -628,8 +628,11 @@ vnode_pager_input_smlfs(vm_object_t object, vm_page_t bwait(bp, PVM, "vnsrd"); - if ((bp->b_ioflags & BIO_ERROR) != 0) - error = EIO; + if ((bp->b_ioflags & BIO_ERROR) != 0) { + KASSERT(bp->b_error != 0, + ("%s: buf error but b_error == 0\n", __func__)); + error = bp->b_error; + } /* * free the buffer header back to the swap buffer pool @@ -1113,7 +1116,9 @@ vnode_pager_generic_getpages_done(struct buf *bp) off_t tfoff, nextoff; int i, error; - error = (bp->b_ioflags & BIO_ERROR) != 0 ? EIO : 0; + KASSERT((bp->b_ioflags & BIO_ERROR) == 0 || bp->b_error != 0, + ("%s: buf error but b_error == 0\n", __func__)); + error = (bp->b_ioflags & BIO_ERROR) != 0 ? bp->b_error : 0; object = bp->b_vp->v_object; if (error == 0 && bp->b_bcount != bp->b_npages * PAGE_SIZE) {