diff options
author | Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com> | 2024-05-23 12:06:36 +0200 |
---|---|---|
committer | Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com> | 2024-05-28 17:19:38 +0200 |
commit | 46f19270265fe54cda1c728cb156b755273b4ab6 (patch) | |
tree | 5c736901750b0f12d7dfb962805480828249913a /super-intel.c | |
parent | mdadm.h: provide basename if GLIBC is not avialable (diff) | |
download | mdadm-46f19270265fe54cda1c728cb156b755273b4ab6.tar.xz mdadm-46f19270265fe54cda1c728cb156b755273b4ab6.zip |
imsm: fix first volume autolayout with IMSM_NO_PLATFORM
Autolayout_imsm() is not executed if IMSM_NO_PLATFORM=1 is set.
This causes that first volume cannot be created. Disk for new volume are
never configured.
Fix it by making autolayout_imsm() independent from super->orom because
NULL there means that IMSM_NO_PLATFORM=1 is set. There are not platform
restrictions to create volume, we just analyze drives. It is safe.
Fixes: 6d4d9ab295de ("imsm: use same slot across container")
Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
Diffstat (limited to '')
-rw-r--r-- | super-intel.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/super-intel.c b/super-intel.c index 0287a618..29652196 100644 --- a/super-intel.c +++ b/super-intel.c @@ -7706,9 +7706,11 @@ static int validate_geometry_imsm(struct supertype *st, int level, int layout, char *dev, unsigned long long *freesize, int consistency_policy, int verbose) { - int fd, cfd; + struct intel_super *super = st->sb; struct mdinfo *sra; int is_member = 0; + imsm_status_t rv; + int fd, cfd; /* load capability * if given unused devices create a container @@ -7733,11 +7735,10 @@ static int validate_geometry_imsm(struct supertype *st, int level, int layout, } if (!dev) { - struct intel_super *super = st->sb; - /* * Autolayout mode, st->sb must be set. */ + if (!super) { pr_vrb("superblock must be set for autolayout, aborting\n"); return 0; @@ -7749,20 +7750,19 @@ static int validate_geometry_imsm(struct supertype *st, int level, int layout, return 0; if (super->orom && freesize) { - imsm_status_t rv; - int count = count_volumes(super->hba, super->orom->dpa, - verbose); + int count = count_volumes(super->hba, super->orom->dpa, verbose); + if (super->orom->vphba <= count) { pr_vrb("platform does not support more than %d raid volumes.\n", super->orom->vphba); return 0; } + } - rv = autolayout_imsm(super, raiddisks, size, *chunk, - freesize); + rv = autolayout_imsm(super, raiddisks, size, *chunk, freesize); if (rv != IMSM_STATUS_OK) return 0; - } + return 1; } if (st->sb) { |