Download raw body.
[patch] [ok?] bioctl: disallow -c 1C with only one chunk (as per man page)
[patch] [ok?] bioctl: disallow -c 1C with only one chunk (as per man page)
[patch] [ok?] bioctl: disallow -c 1C with only one chunk (as per man page)
On 26.04.24 11:53, Stefan Sperling wrote: > On Fri, Apr 26, 2024 at 11:12:18AM +0200, Alexander Klimov wrote: >> Hello everyone! >> >> bioctl(8) clearly states that "The RAID 1C discipline >> requires a minimum of two chunks when a new volume is created". >> >> However, bio_createraid() in /usr/src/sbin/bioctl/bioctl.c requires >> only min_disks = 1; for 1C, allowing me a "bioctl -c 1C -l sdXY softraid0". >> >> Luckily the kernel complains with "softraid0: RAID 1C requires two or more chunks". >> >> The attached diff lets /sbin/bioctl complain with "bioctl: not enough disks". >> Ok? > > Not ok, this was done on purpose. > With your diff there is no way to recover from a broken chunk. Indeed, bioctl -c also assembles *existing* (detached via -d) RAIDs. At least 1C ones. Thank you! Was curious how to do that. But then shouldn't one be able to do that with other disciplines as well? If one should, shall I create a new patch for this? > >> --- /usr/src/sbin/bioctl/bioctl.c >> +++ /usr/src/sbin/bioctl/bioctl.c >> @@ -857,8 +857,10 @@ E.g. RAID 5 here consists of at least 2 chunks when degraded, but not yet failed, and one more when ok. But this line demands at least 3 chunks. I.e. I couldn't assemble a degraded RAID 5 with 2 (3) chunks. >> min_disks = 3; >> break; >> case 'C': >> - case 0x1C: >> min_disks = 1; >> + break; >> + case 0x1C: >> + min_disks = 2; >> break; >> case 'c': >> min_disks = 1; >
[patch] [ok?] bioctl: disallow -c 1C with only one chunk (as per man page)
[patch] [ok?] bioctl: disallow -c 1C with only one chunk (as per man page)
[patch] [ok?] bioctl: disallow -c 1C with only one chunk (as per man page)