From 2e5e6558e4b6e7055068234be7d9eb8f1e886fd3 Mon Sep 17 00:00:00 2001 From: krw Date: Fri, 28 Apr 2017 23:33:07 +0000 Subject: [PATCH] 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@ --- sys/dev/softraid_concat.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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 * Copyright (c) 2011 Joel Sing @@ -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); } -- 2.20.1