summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMarco Peereboom <marco@cvs.openbsd.org>2007-03-30 20:12:29 +0000
committerMarco Peereboom <marco@cvs.openbsd.org>2007-03-30 20:12:29 +0000
commite8489be7697783b5b680d57d50c70dc7f339d52e (patch)
tree1c9e4ccddac5a7864142cc7a811176bb19ac70df /sys
parent372f626c0782ce37247844aa89259142c98492e4 (diff)
Calculate proper offset in partition table.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/softraid.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/sys/dev/softraid.c b/sys/dev/softraid.c
index 4ece30730e6..1bafcea170f 100644
--- a/sys/dev/softraid.c
+++ b/sys/dev/softraid.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: softraid.c,v 1.9 2007/03/27 04:05:22 marco Exp $ */
+/* $OpenBSD: softraid.c,v 1.10 2007/03/30 20:12:28 marco Exp $ */
/*
* Copyright (c) 2007 Marco Peereboom <marco@peereboom.us>
*
@@ -919,7 +919,7 @@ sr_parse_chunks(struct sr_softc *sc, char *lst, struct sr_chunk_head *cl)
/* get partition size */
ss = name[strlen(name) - 1];
ch_entry->src_meta.scm_size =
- label.d_partitions['a' - ss].p_size;
+ label.d_partitions[ss - 'a'].p_size;
if (ch_entry->src_meta.scm_size == 0) {
printf("%s: %s partition size = 0\n",
DEVNAME(sc), name);
@@ -927,9 +927,10 @@ sr_parse_chunks(struct sr_softc *sc, char *lst, struct sr_chunk_head *cl)
}
/* make sure the partition is of the right type */
- if (label.d_partitions['a' - ss].p_fstype != FS_RAID) {
- printf("%s: %s partition not of type RAID\n",
- DEVNAME(sc), name);
+ if (label.d_partitions[ss - 'a'].p_fstype != FS_RAID) {
+ printf("%s: %s partition not of type RAID (%d)\n",
+ DEVNAME(sc), name,
+ label.d_partitions[ss - 'a'].p_fstype);
goto unlock;
}