diff options
author | Kinga Tanska <kinga.tanska@intel.com> | 2020-05-29 08:31:36 +0200 |
---|---|---|
committer | Jes Sorensen <jsorensen@fb.com> | 2020-06-05 17:20:49 +0200 |
commit | 7758ada9f3872cc9cb4c76c733dbc553562b3d7d (patch) | |
tree | 8110e2412445417e5d98765f79eb4696c9c4c63f | |
parent | restripe: fix ignoring return value of ‘read’ and lseek (diff) | |
download | mdadm-7758ada9f3872cc9cb4c76c733dbc553562b3d7d.tar.xz mdadm-7758ada9f3872cc9cb4c76c733dbc553562b3d7d.zip |
Block overwriting existing links while manual assembly
Manual assembly with existing link caused overwriting
this link. Add checking link and block this situation.
Signed-off-by: Kinga Tanska <kinga.tanska@intel.com>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
-rw-r--r-- | Assemble.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -1482,6 +1482,10 @@ try_again: name = content->name; break; } + if (mddev && map_by_name(&map, mddev) != NULL) { + pr_err("Cannot create device with %s because is in use\n", mddev); + goto out; + } if (!auto_assem) /* If the array is listed in mdadm.conf or on * command line, then we trust the name |