All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH,v2] Block overwriting existing links while manual assembly
@ 2020-05-29  6:31 Kinga Tanska
  2020-06-05 15:14 ` Jes Sorensen
  0 siblings, 1 reply; 2+ messages in thread
From: Kinga Tanska @ 2020-05-29  6:31 UTC (permalink / raw)
  To: linux-raid; +Cc: jes.sorensen

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>
---
 Assemble.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Assemble.c b/Assemble.c
index 6b5a7c8e..92616251 100644
--- a/Assemble.c
+++ b/Assemble.c
@@ -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
-- 
2.16.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH,v2] Block overwriting existing links while manual assembly
  2020-05-29  6:31 [PATCH,v2] Block overwriting existing links while manual assembly Kinga Tanska
@ 2020-06-05 15:14 ` Jes Sorensen
  0 siblings, 0 replies; 2+ messages in thread
From: Jes Sorensen @ 2020-06-05 15:14 UTC (permalink / raw)
  To: Kinga Tanska, linux-raid

On 5/29/20 2:31 AM, Kinga Tanska wrote:
> 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>
> ---
>  Assemble.c | 4 ++++
>  1 file changed, 4 insertions(+)

Applied!

Thanks,
Jes

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-06-05 15:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-29  6:31 [PATCH,v2] Block overwriting existing links while manual assembly Kinga Tanska
2020-06-05 15:14 ` Jes Sorensen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.