From: Alexander Klimov Subject: [patch] [ok?] bioctl: properly indicate key disk for RAID 1C in addition to crypto To: tech@openbsd.org Date: Sun, 28 Apr 2024 19:31:12 +0200 Hello everyone! Without the diff below bioctl displays a strange RAID member of 0 size: # bioctl softraid0 Volume Status Size Device softraid0 0 Online 500107558912 sd5 CRYPTO 0 Online 500107558912 0:0.0 noencl softraid0 1 Online 2999999705088 sd6 RAID1C 0 Online 2999999705088 1:0.0 noencl 1 Online 2999999705088 1:1.0 noencl 2 Online 0 1:2.0 noencl With the diff it identifies that as the key disk, just like in crypto: # bioctl softraid0 Volume Status Size Device softraid0 0 Online 500107558912 sd5 CRYPTO 0 Online 500107558912 0:0.0 noencl softraid0 1 Online 2999999705088 sd6 RAID1C 0 Online 2999999705088 1:0.0 noencl 1 Online 2999999705088 1:1.0 noencl 2 Online key disk 1:2.0 noencl Ok? --- /usr/src/sbin/bioctl/bioctl.c +++ /usr/src/sbin/bioctl/bioctl.c @@ -563,7 +563,8 @@ snprintf(volname, sizeof volname, " %3u", bd.bd_diskid); - if (bv.bv_level == 'C' && bd.bd_size == 0) + if ((bv.bv_level == 'C' || bv.bv_level == 0x1C) + && bd.bd_size == 0) snprintf(size, sizeof size, "%14s", "key disk"); else if (human) fmt_scaled(bd.bd_size, size);