From 6e46bf344bf34a688696e240596f8259e328eea9 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 13 Oct 2009 17:41:53 -0700 Subject: imsm: add --update=uuid support When disks have conflicting container memberships (same container ids but incompatible member arrays) --update=uuid can be used to move offenders to a new container id by changing 'orig_family_num'. Note that this only supports random updates of the uuid as the actual uuid is synthesized. We also need to communicate the new 'orig_family_num' value to all disks involved in the update. A new field 'update_private' is added to struct mdinfo to allow this information to be transmitted. Signed-off-by: Dan Williams --- mdadm.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'mdadm.h') diff --git a/mdadm.h b/mdadm.h index 91ba624..04b87b8 100644 --- a/mdadm.h +++ b/mdadm.h @@ -153,6 +153,11 @@ struct mdinfo { int cache_size; /* size of raid456 stripe cache*/ int mismatch_cnt; char text_version[50]; + void *update_private; /* for passing metadata-format + * specific update data + * between successive calls to + * update_super() + */ int container_member; /* for assembling external-metatdata arrays * This is to be used internally by metadata -- cgit From aae5a11207cf6da1682e6a76e116a19e21473f03 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 13 Oct 2009 17:41:57 -0700 Subject: Detail: export MD_UUID from mapfile The load_super() from an mdadm --detail call may race against an mdmon update. When this happens the load_super sees an inconsistent metadata block and returns an error. The fallback path to use the map file contents lacks uuid reporting, so provide __fname_from_uuid for generically printing a uuid. Reported-by: Hans de Goede Signed-off-by: Dan Williams --- mdadm.h | 1 + 1 file changed, 1 insertion(+) (limited to 'mdadm.h') diff --git a/mdadm.h b/mdadm.h index 04b87b8..8212a2c 100644 --- a/mdadm.h +++ b/mdadm.h @@ -810,6 +810,7 @@ extern void uuid_from_super(int uuid[4], mdp_super_t *super); extern const int uuid_match_any[4]; extern int same_uuid(int a[4], int b[4], int swapuuid); extern void copy_uuid(void *a, int b[4], int swapuuid); +extern char *__fname_from_uuid(int id[4], int swap, char *buf, char sep); extern char *fname_from_uuid(struct supertype *st, struct mdinfo *info, char *buf, char sep); extern unsigned long calc_csum(void *super, int bytes); -- cgit From 9f1da8242161ba684f2867f211eb7e9d4baa84bb Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 13 Oct 2009 17:37:02 -0700 Subject: mdmon: preserve socket over chroot Connect to the monitor in the old namespace and use that connection for WaitClean requests when stopping the victim mdmon instance. This allows ping_monitor() to work post chroot(). Cc: Hans de Goede Signed-off-by: Dan Williams --- mdadm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mdadm.h') diff --git a/mdadm.h b/mdadm.h index 8212a2c..ffa5f53 100644 --- a/mdadm.h +++ b/mdadm.h @@ -753,7 +753,7 @@ extern int Monitor(mddev_dev_t devlist, extern int Kill(char *dev, int force, int quiet, int noexcl); extern int Wait(char *dev); -extern int WaitClean(char *dev, int verbose); +extern int WaitClean(char *dev, int sock, int verbose); extern int Incremental(char *devname, int verbose, int runstop, struct supertype *st, char *homehost, int require_homehost, -- cgit From 9a36a9b713a6c789f268251a81de67bb8fd9c7f8 Mon Sep 17 00:00:00 2001 From: Zdenek Behan Date: Mon, 19 Oct 2009 13:13:58 +1100 Subject: Monitor: add option to specify rebuild increments ie. the percent increments after which RebuildNN event is generated This is particulary useful when using --program option, rather than (only) syslog for alerts. Signed-off-by: Zdenek Behan Signed-off-by: NeilBrown --- mdadm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mdadm.h') diff --git a/mdadm.h b/mdadm.h index ffa5f53..2e2275c 100644 --- a/mdadm.h +++ b/mdadm.h @@ -749,7 +749,7 @@ extern int Examine(mddev_dev_t devlist, int brief, int export, int scan, extern int Monitor(mddev_dev_t devlist, char *mailaddr, char *alert_cmd, int period, int daemonise, int scan, int oneshot, - int dosyslog, int test, char *pidfile); + int dosyslog, int test, char *pidfile, int increments); extern int Kill(char *dev, int force, int quiet, int noexcl); extern int Wait(char *dev); -- cgit