aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoursoir <chat@joursoir.net>2023-01-16 03:45:54 +0400
committerJoursoir <chat@joursoir.net>2023-01-16 13:33:18 +0400
commitd93952a43b90635e052abfc808d5966ff750f18a (patch)
tree0e58247af86ad43f7e6972b2664a7be7afa6c7c5
parent3cd29884742a707ff7ff765d104b3a37ea28ea52 (diff)
downloadsbdd-d93952a43b90635e052abfc808d5966ff750f18a.tar.gz
sbdd-d93952a43b90635e052abfc808d5966ff750f18a.tar.bz2
sbdd-d93952a43b90635e052abfc808d5966ff750f18a.zip
require 2 or more disks to make a RAID0 array
Task: 2
-rw-r--r--sbdd.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sbdd.c b/sbdd.c
index 39eab65..86ec402 100644
--- a/sbdd.c
+++ b/sbdd.c
@@ -178,6 +178,11 @@ static int sbdd_create(void)
unsigned int max_sectors;
sector_t totalsize = 0;
+ if (__sbdd_diskcount < 2) {
+ pr_err("not enough disks to make a RAID0\n");
+ return -EFAULT;
+ }
+
ret = bioset_init(&__sbdd_bio_set, BIO_POOL_SIZE, 0, 0);
if (ret) {
pr_err("create BIO set failed: %d\n", ret);