Correctly compensate for both offset and unoffset on-disk BSD disklabels.

Sponsored by:	DARPA & NAI Labs.
This commit is contained in:
Poul-Henning Kamp 2002-10-07 13:11:28 +00:00
parent 88b2247e41
commit dfaf0d8cf1
2 changed files with 4 additions and 2 deletions

View File

@ -526,7 +526,8 @@ dskread(void *buf, unsigned lba, unsigned nblk)
printf("Invalid %s\n", "partition");
return -1;
}
dsk.start = d->d_partitions[dsk.part].p_offset;
dsk.start += d->d_partitions[dsk.part].p_offset;
dsk.start -= d->d_partitions[RAW_PART].p_offset;
}
}
return drvread(buf, dsk.start + lba, nblk);

View File

@ -526,7 +526,8 @@ dskread(void *buf, unsigned lba, unsigned nblk)
printf("Invalid %s\n", "partition");
return -1;
}
dsk.start = d->d_partitions[dsk.part].p_offset;
dsk.start += d->d_partitions[dsk.part].p_offset;
dsk.start -= d->d_partitions[RAW_PART].p_offset;
}
}
return drvread(buf, dsk.start + lba, nblk);