svn commit: r358143 - head/sys/vm
Warner Losh
imp at FreeBSD.org
Thu Feb 20 01:33:02 UTC 2020
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) {
More information about the svn-src-all
mailing list