diff options
author | phk <phk@FreeBSD.org> | 2002-03-05 13:25:57 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2002-03-05 13:25:57 +0000 |
commit | 9e88201c6fc09a29477e1446e27ab998a39971f6 (patch) | |
tree | e71140a199aaca8ec612ab4be8e39e8bd3f9a4b1 /sys | |
parent | ca8983659dde8fdcc8d88650a1c0388efeb4120e (diff) | |
download | FreeBSD-src-9e88201c6fc09a29477e1446e27ab998a39971f6.zip FreeBSD-src-9e88201c6fc09a29477e1446e27ab998a39971f6.tar.gz |
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.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/fs/specfs/spec_vnops.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/fs/specfs/spec_vnops.c b/sys/fs/specfs/spec_vnops.c index 6c4fcd9..ba0e47b 100644 --- a/sys/fs/specfs/spec_vnops.c +++ b/sys/fs/specfs/spec_vnops.c @@ -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)); |