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:
parent
b84271d866
commit
26facaeb4d
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=91683
@ -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));
|
||||
|
Loading…
Reference in New Issue
Block a user