Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev Treat partial read from backing store as I/O error.



details:   https://anonhg.NetBSD.org/src/rev/4e9e0095d97f
branches:  trunk
changeset: 828622:4e9e0095d97f
user:      hannken <hannken%NetBSD.org@localhost>
date:      Thu Dec 21 15:50:33 2017 +0000

description:
Treat partial read from backing store as I/O error.

diffstat:

 sys/dev/fss.c |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (36 lines):

diff -r d4a7826ace89 -r 4e9e0095d97f sys/dev/fss.c
--- a/sys/dev/fss.c     Thu Dec 21 14:32:06 2017 +0000
+++ b/sys/dev/fss.c     Thu Dec 21 15:50:33 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fss.c,v 1.100 2017/12/17 22:09:47 pgoyette Exp $       */
+/*     $NetBSD: fss.c,v 1.101 2017/12/21 15:50:33 hannken Exp $        */
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fss.c,v 1.100 2017/12/17 22:09:47 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fss.c,v 1.101 2017/12/21 15:50:33 hannken Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -980,6 +980,8 @@
                todo -= len;
        }
        error = biowait(mbp);
+       if (error == 0 && mbp->b_resid != 0)
+               error = EIO;
        putiobuf(mbp);
 
        mutex_enter(&sc->sc_slock);
@@ -1204,6 +1206,8 @@
                        bdev_strategy(nbp);
 
                        error = biowait(nbp);
+                       if (error == 0 && nbp->b_resid != 0)
+                               error = EIO;
                        if (error != 0) {
                                bp->b_resid = bp->b_bcount;
                                bp->b_error = nbp->b_error;



Home | Main Index | Thread Index | Old Index