From e60ad901b2c4b93e062e8db3ba6410092b0f579d Mon Sep 17 00:00:00 2001 From: chs Date: Sun, 27 Oct 2002 16:53:20 +0000 Subject: [PATCH] examine the B_ERROR flag instead of the b_error field to determine whether or not an error has occured. pointed out by Stephan Uphoff. --- sys/uvm/uvm_swap.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/sys/uvm/uvm_swap.c b/sys/uvm/uvm_swap.c index 58877afd7047..5526490a782c 100644 --- a/sys/uvm/uvm_swap.c +++ b/sys/uvm/uvm_swap.c @@ -1,4 +1,4 @@ -/* $NetBSD: uvm_swap.c,v 1.71 2002/10/23 09:15:10 jdolecek Exp $ */ +/* $NetBSD: uvm_swap.c,v 1.72 2002/10/27 16:53:20 chs Exp $ */ /* * Copyright (c) 1995, 1996, 1997 Matthew R. Green @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: uvm_swap.c,v 1.71 2002/10/23 09:15:10 jdolecek Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uvm_swap.c,v 1.72 2002/10/27 16:53:20 chs Exp $"); #include "fs_nfs.h" #include "opt_uvmhist.h" @@ -1384,7 +1384,7 @@ sw_reg_iodone(bp) struct vndxfer *vnx = vbp->vb_xfer; struct buf *pbp = vnx->vx_bp; /* parent buffer */ struct swapdev *sdp = vnx->vx_sdp; - int s, resid; + int s, resid, error; UVMHIST_FUNC("sw_reg_iodone"); UVMHIST_CALLED(pdhist); UVMHIST_LOG(pdhist, " vbp=%p vp=%p blkno=%x addr=%p", @@ -1401,12 +1401,11 @@ sw_reg_iodone(bp) pbp->b_resid -= resid; vnx->vx_pending--; - if (vbp->vb_buf.b_error) { - UVMHIST_LOG(pdhist, " got error=%d !", - vbp->vb_buf.b_error, 0, 0, 0); - + if (vbp->vb_buf.b_flags & B_ERROR) { /* pass error upward */ - vnx->vx_error = vbp->vb_buf.b_error; + error = vbp->vb_buf.b_error ? vbp->vb_buf.b_error : EIO; + UVMHIST_LOG(pdhist, " got error=%d !", error, 0, 0, 0); + vnx->vx_error = error; } /*