summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2017-04-28 23:33:08 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2017-04-28 23:33:08 +0000
commit9a2e52e5a88895c737bc51e50c5911d68b3f7f2d (patch)
tree455d7f80738de435b05e721e610cdbb3e7d3d347
parent33fc892654c80218e52d4b7261d7fa1566ab8a7a (diff)
Restore calculation of volume size. Accidentally removed in
r1.25. Fixes creation of concat volumes. Noticed by and diff from Thordur I. Bjornsson via tech@ ok jsing@
-rw-r--r--sys/dev/softraid_concat.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/dev/softraid_concat.c b/sys/dev/softraid_concat.c
index 90cb12c8b6e..b96a016b274 100644
--- a/sys/dev/softraid_concat.c
+++ b/sys/dev/softraid_concat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: softraid_concat.c,v 1.25 2016/04/12 16:26:54 krw Exp $ */
+/* $OpenBSD: softraid_concat.c,v 1.26 2017/04/28 23:33:07 krw Exp $ */
/*
* Copyright (c) 2008 Marco Peereboom <marco@peereboom.us>
* Copyright (c) 2011 Joel Sing <jsing@openbsd.org>
@@ -60,11 +60,19 @@ int
sr_concat_create(struct sr_discipline *sd, struct bioc_createraid *bc,
int no_chunk, int64_t coerced_size)
{
+ int i;
+
if (no_chunk < 2) {
sr_error(sd->sd_sc, "%s requires two or more chunks",
sd->sd_name);
return EINVAL;
}
+
+ sd->sd_meta->ssdi.ssd_size = 0;
+ for (i = 0; i < no_chunk; i++) {
+ sd->sd_meta->ssdi.ssd_size +=
+ sd->sd_vol.sv_chunks[i]->src_size;
+ }
return sr_concat_init(sd);
}