If in strategy we find that we have no devsw on the device anymore we

are probably talking about some disk-device which wente away, so
return ENXIO instead of panicing.
This commit is contained in:
Poul-Henning Kamp 2002-03-05 13:25:57 +00:00
parent b84271d866
commit 26facaeb4d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=91683

View File

@ -485,9 +485,12 @@ spec_strategy(ap)
mp->mnt_stat.f_syncreads++;
}
}
KASSERT(devsw(bp->b_dev) != NULL,
("No devsw on dev %s responsible for buffer %p\n",
devtoname(bp->b_dev), bp));
if (devsw(bp->b_dev) == NULL) {
bp->b_io.bio_error = ENXIO;
bp->b_io.bio_flags |= BIO_ERROR;
biodone(&bp->b_io);
return (0);
}
KASSERT(devsw(bp->b_dev)->d_strategy != NULL,
("No strategy on dev %s responsible for buffer %p\n",
devtoname(bp->b_dev), bp));