Correctly compensate for both offset and unoffset on-disk BSD disklabels.
Sponsored by: DARPA & NAI Labs.
This commit is contained in:
parent
88b2247e41
commit
dfaf0d8cf1
@ -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);
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user