diff options
author | phk <phk@FreeBSD.org> | 2005-01-29 16:49:43 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2005-01-29 16:49:43 +0000 |
commit | 1a5ece93a12777fe7b10a79d14f37529eb9ecdb5 (patch) | |
tree | 34263cc79f40b182cfdc9cd5584876dd4fae9d3a /sys/geom/geom_disk.c | |
parent | e2e185e368dbff70d94f3664fa57f9d20b60b991 (diff) | |
download | FreeBSD-src-1a5ece93a12777fe7b10a79d14f37529eb9ecdb5.zip FreeBSD-src-1a5ece93a12777fe7b10a79d14f37529eb9ecdb5.tar.gz |
When dumping to a unpartitioned disk, make sure to chop the
length of the dump area accordingly.
Run into by: scottl
Diffstat (limited to 'sys/geom/geom_disk.c')
-rw-r--r-- | sys/geom/geom_disk.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/geom/geom_disk.c b/sys/geom/geom_disk.c index bddb1c9..9145b3b 100644 --- a/sys/geom/geom_disk.c +++ b/sys/geom/geom_disk.c @@ -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); |