Skip to content
This repository has been archived by the owner on Oct 12, 2020. It is now read-only.

Commit

Permalink
imsm: block using partition
Browse files Browse the repository at this point in the history
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 691c6ee
("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>
  • Loading branch information
mtkaczyk authored and Jes Sorensen committed Sep 28, 2018
1 parent 783a4a9 commit 3a30e28
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions super-intel.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 3a30e28

Please sign in to comment.