Date: Thu, 20 Feb 2020 01:33:01 +0000 (UTC) From: Warner Losh <imp@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r358143 - head/sys/vm Message-ID: <202002200133.01K1X1wC092258@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202002200133.01K1X1wC092258>