linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Fixes for Incremental()
@ 2010-12-17 14:16 Przemyslaw Czarnowski
  2010-12-17 14:17 ` [PATCH 1/2] fix: adding spare via incremental do not trigger recovery Przemyslaw Czarnowski
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Przemyslaw Czarnowski @ 2010-12-17 14:16 UTC (permalink / raw)
  To: neilb; +Cc: linux-raid, dan.j.williams, ed.ciechanowski

The following series consists of two fixes for problems revealed during the tests 
of autorebuild. First one is quite important, as recovery process do not start
if bare disk is added to degraded array via incremental. Second one is just
a change in return value of array_try_spare().

---

Przemyslaw Czarnowski (2):
      fix: adding spare via incremental do not trigger recovery
      fix: incremental for bare disks return invalid value


 Incremental.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

-- 
Best regards,
Przemyslaw Czarnowski

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

* [PATCH 1/2] fix: adding spare via incremental do not trigger recovery
  2010-12-17 14:16 [PATCH 0/2] Fixes for Incremental() Przemyslaw Czarnowski
@ 2010-12-17 14:17 ` Przemyslaw Czarnowski
  2010-12-17 14:18 ` [PATCH 2/2] fix: incremental for bare disks returns invalid value Przemyslaw Czarnowski
  2010-12-20 22:12 ` [PATCH 0/2] Fixes for Incremental() Neil Brown
  2 siblings, 0 replies; 4+ messages in thread
From: Przemyslaw Czarnowski @ 2010-12-17 14:17 UTC (permalink / raw)
  To: neilb; +Cc: linux-raid, dan.j.williams, ed.ciechanowski

After incremental has added spare, monitor should be woken up in order
to see if anything has changed. If mdmon is not waken up, recovery do not
start.
---
 Incremental.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/Incremental.c b/Incremental.c
index bc4531a..abd7b81 100644
--- a/Incremental.c
+++ b/Incremental.c
@@ -443,6 +443,7 @@ int Incremental(char *devname, int verbose, int runstop,
 	/* 7/ Is there enough devices to possibly start the array? */
 	/* 7a/ if not, finish with success. */
 	if (info.array.level == LEVEL_CONTAINER) {
+		char *devname = NULL;
 		/* Try to assemble within the container */
 		map_unlock(&map);
 		sysfs_uevent(&info, "change");
@@ -451,6 +452,8 @@ int Incremental(char *devname, int verbose, int runstop,
 				": container %s now has %d devices\n",
 				chosen_name, info.array.working_disks);
 		wait_for(chosen_name, mdfd);
+		if (st->ss->external)
+				 devname = devnum2devname(fd2devnum(mdfd));
 		close(mdfd);
 		sysfs_free(sra);
 		rv = Incremental(chosen_name, verbose, runstop,
@@ -460,6 +463,12 @@ int Incremental(char *devname, int verbose, int runstop,
 			 * have enough devices to start yet
 			 */
 			rv = 0;
+		/* after spare is added, ping monitor for external metadata
+		 * so that it can eg. try to rebuild degraded array */
+		if (st->ss->external) {
+			ping_monitor(devname);
+			free(devname);
+		}
 		return rv;
 	}
 


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

* [PATCH 2/2] fix: incremental for bare disks returns invalid value
  2010-12-17 14:16 [PATCH 0/2] Fixes for Incremental() Przemyslaw Czarnowski
  2010-12-17 14:17 ` [PATCH 1/2] fix: adding spare via incremental do not trigger recovery Przemyslaw Czarnowski
@ 2010-12-17 14:18 ` Przemyslaw Czarnowski
  2010-12-20 22:12 ` [PATCH 0/2] Fixes for Incremental() Neil Brown
  2 siblings, 0 replies; 4+ messages in thread
From: Przemyslaw Czarnowski @ 2010-12-17 14:18 UTC (permalink / raw)
  To: neilb; +Cc: linux-raid, dan.j.williams, ed.ciechanowski

return value should remain the same as result of Manage_Subdevs (last
significant operation). Right now it is inverted what results in
error status for successful operation.
---
 Incremental.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Incremental.c b/Incremental.c
index abd7b81..09c3c41 100644
--- a/Incremental.c
+++ b/Incremental.c
@@ -1002,7 +1002,7 @@ static int array_try_spare(char *devname, int *dfdp, struct dev_policy *pol,
 		}
 		sysfs_free(chosen);
 	}
-	return rv ? 0 : 1;
+	return rv;
 }
 
 static int partition_try_spare(char *devname, int *dfdp, struct dev_policy *pol,


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

* Re: [PATCH 0/2] Fixes for Incremental()
  2010-12-17 14:16 [PATCH 0/2] Fixes for Incremental() Przemyslaw Czarnowski
  2010-12-17 14:17 ` [PATCH 1/2] fix: adding spare via incremental do not trigger recovery Przemyslaw Czarnowski
  2010-12-17 14:18 ` [PATCH 2/2] fix: incremental for bare disks returns invalid value Przemyslaw Czarnowski
@ 2010-12-20 22:12 ` Neil Brown
  2 siblings, 0 replies; 4+ messages in thread
From: Neil Brown @ 2010-12-20 22:12 UTC (permalink / raw)
  To: Przemyslaw Czarnowski; +Cc: linux-raid, dan.j.williams, ed.ciechanowski

On Fri, 17 Dec 2010 15:16:58 +0100 Przemyslaw Czarnowski
<przemyslaw.hawrylewicz.czarnowski@intel.com> wrote:

> The following series consists of two fixes for problems revealed during the tests 
> of autorebuild. First one is quite important, as recovery process do not start
> if bare disk is added to degraded array via incremental. Second one is just
> a change in return value of array_try_spare().
> 
> ---
> 
> Przemyslaw Czarnowski (2):
>       fix: adding spare via incremental do not trigger recovery
>       fix: incremental for bare disks return invalid value

Both applied,
Thanks,

NeilBrown

> 
> 
>  Incremental.c |   11 ++++++++++-
>  1 files changed, 10 insertions(+), 1 deletions(-)
> 


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

end of thread, other threads:[~2010-12-20 22:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-17 14:16 [PATCH 0/2] Fixes for Incremental() Przemyslaw Czarnowski
2010-12-17 14:17 ` [PATCH 1/2] fix: adding spare via incremental do not trigger recovery Przemyslaw Czarnowski
2010-12-17 14:18 ` [PATCH 2/2] fix: incremental for bare disks returns invalid value Przemyslaw Czarnowski
2010-12-20 22:12 ` [PATCH 0/2] Fixes for Incremental() Neil Brown

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).