Return ENODEV in case the driver has no dump routine.

This commit is contained in:
Poul-Henning Kamp 2003-09-29 07:44:23 +00:00
parent b22df41bbd
commit 5774cead7a

View File

@ -159,6 +159,10 @@ g_disk_kerneldump(struct bio *bp, struct disk *dp)
gp = bp->bio_to->geom;
g_trace(G_T_TOPOLOGY, "g_disk_kernedump(%s, %jd, %jd)",
gp->name, (intmax_t)gkd->offset, (intmax_t)gkd->length);
if (dp->d_dump == NULL) {
g_io_deliver(bp, ENODEV);
return;
}
di.dumper = dp->d_dump;
di.priv = dp;
di.blocksize = dp->d_sectorsize;