linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] md: notify about new spare disk in the container
@ 2017-07-21 10:19 Alexey Obitotskiy
  2017-07-21 20:24 ` Shaohua Li
  0 siblings, 1 reply; 4+ messages in thread
From: Alexey Obitotskiy @ 2017-07-21 10:19 UTC (permalink / raw)
  To: linux-raid; +Cc: shli

In case of external metadata arrays spare disks are added to containers
first. mdadm keeps monitoring /proc/mdstat output and when spare disk is
available, it moves it from the container to the array. The problem is
there is no notification of new spare disk in the container and mdadm
waits a long time (until timeout) before it takes the action.

Signed-off-by: Alexey Obitotskiy <aleksey.obitotskiy@intel.com>
---
 drivers/md/md.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/md/md.c b/drivers/md/md.c
index 66f6b92..02f4c6f 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -4283,6 +4283,7 @@ new_dev_store(struct mddev *mddev, const char *buf, size_t len)
 	if (err)
 		export_rdev(rdev);
 	mddev_unlock(mddev);
+	md_new_event(mddev);
 	return err ? err : len;
 }
 
-- 
2.7.4


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

* Re: [PATCH] md: notify about new spare disk in the container
  2017-07-21 10:19 [PATCH] md: notify about new spare disk in the container Alexey Obitotskiy
@ 2017-07-21 20:24 ` Shaohua Li
  2017-07-28 13:49   ` [PATCH v2] " Artur Paszkiewicz
  0 siblings, 1 reply; 4+ messages in thread
From: Shaohua Li @ 2017-07-21 20:24 UTC (permalink / raw)
  To: Alexey Obitotskiy; +Cc: linux-raid

On Fri, Jul 21, 2017 at 12:19:04PM +0200, Alexey Obitotskiy wrote:
> In case of external metadata arrays spare disks are added to containers
> first. mdadm keeps monitoring /proc/mdstat output and when spare disk is
> available, it moves it from the container to the array. The problem is
> there is no notification of new spare disk in the container and mdadm
> waits a long time (until timeout) before it takes the action.

Hopefully we don't need this in the future after mdadm uses sysfs.

> Signed-off-by: Alexey Obitotskiy <aleksey.obitotskiy@intel.com>
> ---
>  drivers/md/md.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/md/md.c b/drivers/md/md.c
> index 66f6b92..02f4c6f 100644
> --- a/drivers/md/md.c
> +++ b/drivers/md/md.c
> @@ -4283,6 +4283,7 @@ new_dev_store(struct mddev *mddev, const char *buf, size_t len)
>  	if (err)
>  		export_rdev(rdev);
>  	mddev_unlock(mddev);
> +	md_new_event(mddev);

Probably only do this in success?

>  	return err ? err : len;
>  }
>  
> -- 
> 2.7.4
> 

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

* [PATCH v2] md: notify about new spare disk in the container
  2017-07-21 20:24 ` Shaohua Li
@ 2017-07-28 13:49   ` Artur Paszkiewicz
  2017-07-28 17:00     ` Shaohua Li
  0 siblings, 1 reply; 4+ messages in thread
From: Artur Paszkiewicz @ 2017-07-28 13:49 UTC (permalink / raw)
  To: shli; +Cc: linux-raid

From: "Alexey Obitotskiy" <aleksey.obitotskiy@intel.com>

In case of external metadata arrays spare disks are added to containers
first. mdadm keeps monitoring /proc/mdstat output and when spare disk is
available, it moves it from the container to the array. The problem is
there is no notification of new spare disk in the container and mdadm
waits a long time (until timeout) before it takes the action.

Signed-off-by: Alexey Obitotskiy <aleksey.obitotskiy@intel.com>
---
 drivers/md/md.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/md/md.c b/drivers/md/md.c
index 8cdca0296749..594ebbaf4171 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -4283,6 +4283,8 @@ new_dev_store(struct mddev *mddev, const char *buf, size_t len)
 	if (err)
 		export_rdev(rdev);
 	mddev_unlock(mddev);
+	if (!err)
+		md_new_event(mddev);
 	return err ? err : len;
 }
 
-- 
2.13.1


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

* Re: [PATCH v2] md: notify about new spare disk in the container
  2017-07-28 13:49   ` [PATCH v2] " Artur Paszkiewicz
@ 2017-07-28 17:00     ` Shaohua Li
  0 siblings, 0 replies; 4+ messages in thread
From: Shaohua Li @ 2017-07-28 17:00 UTC (permalink / raw)
  To: Artur Paszkiewicz; +Cc: linux-raid

On Fri, Jul 28, 2017 at 03:49:25PM +0200, Artur Paszkiewicz wrote:
> From: "Alexey Obitotskiy" <aleksey.obitotskiy@intel.com>
> 
> In case of external metadata arrays spare disks are added to containers
> first. mdadm keeps monitoring /proc/mdstat output and when spare disk is
> available, it moves it from the container to the array. The problem is
> there is no notification of new spare disk in the container and mdadm
> waits a long time (until timeout) before it takes the action.
> 
> Signed-off-by: Alexey Obitotskiy <aleksey.obitotskiy@intel.com>
applied, thanks

> ---
>  drivers/md/md.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/md/md.c b/drivers/md/md.c
> index 8cdca0296749..594ebbaf4171 100644
> --- a/drivers/md/md.c
> +++ b/drivers/md/md.c
> @@ -4283,6 +4283,8 @@ new_dev_store(struct mddev *mddev, const char *buf, size_t len)
>  	if (err)
>  		export_rdev(rdev);
>  	mddev_unlock(mddev);
> +	if (!err)
> +		md_new_event(mddev);
>  	return err ? err : len;
>  }
>  
> -- 
> 2.13.1
> 

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

end of thread, other threads:[~2017-07-28 17:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-21 10:19 [PATCH] md: notify about new spare disk in the container Alexey Obitotskiy
2017-07-21 20:24 ` Shaohua Li
2017-07-28 13:49   ` [PATCH v2] " Artur Paszkiewicz
2017-07-28 17:00     ` Shaohua Li

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).