Fix same panic problem as with cd.c when a scsi error happends on
read/write action. It would panic on a diagnosic assertion. When a scsi read/write command fails, the whole extent is gone bad so mark all as not done.
This commit is contained in:
parent
51d37264ff
commit
d1de30eaae
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: sd.c,v 1.249 2006/07/09 17:12:21 drochner Exp $ */
|
/* $NetBSD: sd.c,v 1.250 2006/09/14 17:54:34 reinoud Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 1998, 2003, 2004 The NetBSD Foundation, Inc.
|
* Copyright (c) 1998, 2003, 2004 The NetBSD Foundation, Inc.
|
||||||
|
@ -54,7 +54,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: sd.c,v 1.249 2006/07/09 17:12:21 drochner Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: sd.c,v 1.250 2006/09/14 17:54:34 reinoud Exp $");
|
||||||
|
|
||||||
#include "opt_scsi.h"
|
#include "opt_scsi.h"
|
||||||
#include "rnd.h"
|
#include "rnd.h"
|
||||||
|
@ -935,8 +935,11 @@ sddone(struct scsipi_xfer *xs, int error)
|
||||||
if (bp) {
|
if (bp) {
|
||||||
bp->b_error = error;
|
bp->b_error = error;
|
||||||
bp->b_resid = xs->resid;
|
bp->b_resid = xs->resid;
|
||||||
if (error)
|
if (error) {
|
||||||
|
/* on a read/write error bp->b_resid is zero, so fix */
|
||||||
|
bp->b_resid =bp->b_bcount;
|
||||||
bp->b_flags |= B_ERROR;
|
bp->b_flags |= B_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
disk_unbusy(&sd->sc_dk, bp->b_bcount - bp->b_resid,
|
disk_unbusy(&sd->sc_dk, bp->b_bcount - bp->b_resid,
|
||||||
(bp->b_flags & B_READ));
|
(bp->b_flags & B_READ));
|
||||||
|
|
Loading…
Reference in New Issue