When dumping to a unpartitioned disk, make sure to chop the

length of the dump area accordingly.

Run into by:	scottl
This commit is contained in:
Poul-Henning Kamp 2005-01-29 16:49:43 +00:00
parent 1e48d031c9
commit 3ad9f7c2c5

View File

@ -180,6 +180,8 @@ g_disk_kerneldump(struct bio *bp, struct disk *dp)
di.priv = dp;
di.blocksize = dp->d_sectorsize;
di.mediaoffset = gkd->offset;
if ((gkd->offset + gkd->length) > dp->d_mediasize)
gkd->length = dp->d_mediasize - gkd->offset;
di.mediasize = gkd->length;
error = set_dumper(&di);
g_io_deliver(bp, error);