Module Name: src
Committed By: jnemeth
Date: Tue Oct 22 07:30:20 UTC 2013
Modified Files:
src/sbin/gpt: migrate.c
Log Message:
In a NetBSD disklabel, p_offset is from the beginning of the disk,
not the beginning of the NetBSD partition.
To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sbin/gpt/migrate.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sbin/gpt/migrate.c
diff -u src/sbin/gpt/migrate.c:1.10 src/sbin/gpt/migrate.c:1.11
--- src/sbin/gpt/migrate.c:1.10 Sat Oct 19 09:31:24 2013
+++ src/sbin/gpt/migrate.c Tue Oct 22 07:30:20 2013
@@ -29,7 +29,7 @@
__FBSDID("$FreeBSD: src/sbin/gpt/migrate.c,v 1.16 2005/09/01 02:42:52 marcel Exp $");
#endif
#ifdef __RCSID
-__RCSID("$NetBSD: migrate.c,v 1.10 2013/10/19 09:31:24 jnemeth Exp $");
+__RCSID("$NetBSD: migrate.c,v 1.11 2013/10/22 07:30:20 jnemeth Exp $");
#endif
#include <sys/types.h>
@@ -241,8 +241,8 @@ migrate_netbsd_disklabel(int fd, off_t s
ofs = (le32toh(dl->d_partitions[i].p_offset) *
le32toh(dl->d_secsize)) / secsz;
ofs = (ofs > 0) ? ofs - rawofs : 0;
- ent->ent_lba_start = htole64(start + ofs);
- ent->ent_lba_end = htole64(start + ofs +
+ ent->ent_lba_start = htole64(ofs);
+ ent->ent_lba_end = htole64(ofs +
le32toh(dl->d_partitions[i].p_size) - 1LL);
ent++;
}