sdio: If sd I/O fails because of an I/O error, set the sd state

correctly.

Reported-by:	phk
Approved-by:	jkh
This commit is contained in:
Greg Lehey 2000-03-12 05:05:41 +00:00
parent c87413f73b
commit b6c7afd32c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=57925

View File

@ -891,10 +891,10 @@ sdio(struct buf *bp)
if (drive->state != drive_up) {
if (sd->state >= sd_crashed) {
if (bp->b_flags & B_WRITE) /* writing, */
set_sd_state(sd->sdno, sd_stale, setstate_force);
else
if (bp->b_flags & B_READ) /* reading, */
set_sd_state(sd->sdno, sd_crashed, setstate_force);
else
set_sd_state(sd->sdno, sd_stale, setstate_force);
}
bp->b_flags |= B_ERROR;
bp->b_error = EIO;