diff options
author | Mariusz Tkaczyk <mariusz.tkaczyk@intel.com> | 2018-09-28 09:48:53 +0200 |
---|---|---|
committer | Jes Sorensen <jsorensen@fb.com> | 2018-09-28 16:25:58 +0200 |
commit | 3a30e28ef7d15fcb49bc852216c597fdd5bfcef0 (patch) | |
tree | 7ef04aee60b86b536d4590fb2ff378ba7cccf047 | |
parent | Assemble: set devices to NULL when load_devices can't load device (diff) | |
download | mdadm-3a30e28ef7d15fcb49bc852216c597fdd5bfcef0.tar.xz mdadm-3a30e28ef7d15fcb49bc852216c597fdd5bfcef0.zip |
imsm: block using partition
When IMSM_NO_PLATFORM is exported mdadm allows to create array with
partitions or add partition to existing array but there is no
possibilty to assemble it after stopping, see commit 691c6ee1b6bb
("IMSM/DDF: don't recognised these metadata on partitions.").
When searching for hba capabilities first test device and print
corresponding error if it is a partition.
Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@intel.com>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
-rw-r--r-- | super-intel.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/super-intel.c b/super-intel.c index d3d256a4..6438987b 100644 --- a/super-intel.c +++ b/super-intel.c @@ -4523,6 +4523,11 @@ static int find_intel_hba_capability(int fd, struct intel_super *super, char *de struct sys_dev *hba_name; int rv = 0; + if (fd >= 0 && test_partition(fd)) { + pr_err("imsm: %s is a partition, cannot be used in IMSM\n", + devname); + return 1; + } if (fd < 0 || check_env("IMSM_NO_PLATFORM")) { super->orom = NULL; super->hba = NULL; |