Skip to contentSkip to conversation

rebuild checkpoints, incremental assembly, volume delete/rename, and fixes

GIT PULL Dan Williams 3 participants 13 messages May 27, 2010 – Jul 22, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi Neil,

A collection of updates that have been separated onto individual topic branches. I provide a url, summary, and full diff for each topic if you want to do piecemeal pulls, otherwise the merged set is available here:

git://github.com/djbw/mdadm.git master

Dan Williams (10):
mdmon: fix missing open of md/<dev>/recovery_start
mdmon: periodically checkpoint recovery
imsm: dump each disk's view of the slot state Kill subarray
Rename subarray
Incremental: honor an 'enough' flag from external handlers Revert "Incremental: honor --no-degraded to delay assembly" Merge branch 'subarray' into for-neil
imsm: robustify recovery-start detection
Merge branches 'fixes' and 'hotplug' into for-neil

Dave Jiang (1):
create: Check with OROM limit before setting default chunk size

Przemyslaw Hawrylewicz Czarnowski (1):
fix: memory leak in mdmon_pid()

 Create.c         |    8 +-
 Incremental.c    |   14 ++-
 Kill.c           |   57 ++++++++++
 Manage.c         |   48 +++++++++
 ReadMe.c         |    2 +
 managemon.c      |   45 ++++-----
 mdadm.8          |    5 -
 mdadm.c          |   48 ++++++++-
 mdadm.h          |   20 +++-
 mdmon.c          |   25 +----
 mdmon.h          |    9 ++
 monitor.c        |   33 ++++++
 platform-intel.h |   49 +++++++++
 super-ddf.c      |   26 ++++-
 super-intel.c    |  311 ++++++++++++++++++++++++++++++++++++++++++++++--------
 util.c           |  144 +++++++++++++++++++++++++-
 16 files changed, 731 insertions(+), 113 deletions(-)

Four topics:
1/ git://github.com/djbw/mdadm.git checkpoint

Mdmon now watches sync_completed and records a checkpoint at 1/16 array-size intervals. This branch also has a fixup to allow the platform firmware to override the default chunksize, otherwise we get:

mdadm: platform does not support a chunk size of: 512

Dan Williams (3):
mdmon: fix missing open of md/<dev>/recovery_start
mdmon: periodically checkpoint recovery
imsm: dump each disk's view of the slot state

Dave Jiang (1):
create: Check with OROM limit before setting default chunk size

 Create.c         |    8 ++++++--
 managemon.c      |   45 ++++++++++++++++++++-------------------------
 mdadm.h          |    2 ++
 mdmon.h          |    9 +++++++++
 monitor.c        |   33 +++++++++++++++++++++++++++++++++
 platform-intel.h |   49 +++++++++++++++++++++++++++++++++++++++++++++++++
 super-intel.c    |   24 +++++++++++++++++++++++-
 7 files changed, 142 insertions(+), 28 deletions(-)
Create.c +6 -2
index b04388f..43e5f37 100644
@@ -235,9 +235,13 @@ int Create(struct supertype *st, char *mddev,
 	case 6:
 	case 0:
 		if (chunk == 0) {
-			chunk = 512;
+			if (st && st->ss->default_chunk)
+				chunk = st->ss->default_chunk(st);
+
+			chunk = chunk ? : 512;
+
 			if (verbose > 0)
-				fprintf(stderr, Name ": chunk size defaults to 512K\n");
+				fprintf(stderr, Name ": chunk size defaults to %dK\n", chunk);
 		}
 		break;
 	case LEVEL_LINEAR:
managemon.c +20 -25

76 lines not on this page · raw message

mdadm.h +2 -0
index 1bf5ac0..142868a 100644
@@ -609,6 +609,8 @@ extern struct superswitch {
 	struct mdinfo *(*container_content)(struct supertype *st);
 	/* Allow a metadata handler to override mdadm's default layouts */
 	int (*default_layout)(int level); /* optional */
+	/* query the supertype for default chunk size */
+	int (*default_chunk)(struct supertype *st); /* optional */
 
 /* for mdmon */
 	int (*open_new)(struct supertype *c, struct active_array *a,
mdmon.h +9 -0
index 20a0a01..5c51566 100644
@@ -32,6 +32,15 @@ struct active_array {
 	int action_fd;
 	int resync_start_fd;
 	int metadata_fd; /* for monitoring rw/ro status */
+	int sync_completed_fd; /* for checkpoint notification events */
+	unsigned long long last_checkpoint; /* sync_completed fires for many
+					     * reasons this field makes sure the
+					     * kernel has made progress before
+					     * moving the checkpoint.  It is
+					     * cleared by the metadata handler
+					     * when it determines recovery is
+					     * terminated.
+					     */
 
 	enum array_state prev_state, curr_state, next_state;
 	enum sync_action prev_action, curr_action, next_action;
monitor.c +33 -0
index e43e545..12f8d3e 100644
@@ -80,6 +80,24 @@ static unsigned long long read_resync_start(int fd)
 		return strtoull(buf, NULL, 10);
 }
 
+static unsigned long long read_sync_completed(int fd)
+{
+	unsigned long long val;
+	char buf[50];
+	int n;
+	char *ep;
+
+	n = read_attr(buf, 50, fd);
+
+	if (n <= 0)
+		return 0;
+	buf[n] = 0;
+	val = strtoull(buf, &ep, 0);
+	if (ep == buf || (*ep != 0 && *ep != '\n' && *ep != ' '))
+		return 0;
+	return val;
+}
+
 static enum array_state read_state(int fd)
 {
 	char buf[20];
@@ -195,6 +213,7 @@ static void signal_manager(void)
 
 static int read_and_act(struct active_array *a)
 {
+	unsigned long long sync_completed;
 	int check_degraded = 0;
 	int deactivate = 0;
 	struct mdinfo *mdi;
@@ -206,6 +225,7 @@ static int read_and_act(struct active_array *a)
 	a->curr_state = read_state(a->info.state_fd);
 	a->curr_action = read_action(a->action_fd);
 	a->info.resync_start = read_resync_start(a->resync_start_fd);
+	sync_completed = read_sync_completed(a->sync_completed_fd);
 	for (mdi = a->info.devs; mdi ; mdi = mdi->next) {
 		mdi->next_state = 0;
 		if (mdi->state_fd >= 0) {
@@ -307,6 +327,18 @@ static int read_and_act(struct active_array *a)
 		}
 	}
 
+	/* Check for recovery checkpoint notifications.  We need to be a
+	 * minimum distance away from the last checkpoint to prevent
+	 * over checkpointing.  Note reshape checkpointing is not
+	 * handled here.
+	 */
+	if (sync_completed > a->last_checkpoint &&
+	    sync_completed - a->last_checkpoint > a->info.component_size >> 4 &&
+	    a->curr_action > reshape && a->next_action == bad_action) {
+		a->last_checkpoint = sync_completed;
+		a->next_action = idle;
+	}
+
 	a->container->ss->sync_metadata(a->container);
 	dprintf("%s(%d): state:%s action:%s next(", __func__, a->info.container_member,
 		array_states[a->curr_state], sync_actions[a->curr_action]);
@@ -461,6 +493,7 @@ static int wait_and_act(struct supertype *container, int nowait)
 
 		add_fd(&rfds, &maxfd, a->info.state_fd);
 		add_fd(&rfds, &maxfd, a->action_fd);
+		add_fd(&rfds, &maxfd, a->sync_completed_fd);
 		for (mdi = a->info.devs ; mdi ; mdi = mdi->next)
 			add_fd(&rfds, &maxfd, mdi->state_fd);
 
platform-intel.h +49 -0

55 lines not on this page · raw message

super-intel.c +23 -1
index 677396c..e29491e 100644
@@ -641,7 +641,7 @@ static __u64 blocks_per_migr_unit(struct imsm_dev *dev);
 static void print_imsm_dev(struct imsm_dev *dev, char *uuid, int disk_idx)
 {
 	__u64 sz;
-	int slot;
+	int slot, i;
 	struct imsm_map *map = get_imsm_map(dev, 0);
 	__u32 ord;
 
@@ -650,6 +650,12 @@ static void print_imsm_dev(struct imsm_dev *dev, char *uuid, int disk_idx)
 	printf("           UUID : %s\n", uuid);
 	printf("     RAID Level : %d\n", get_imsm_raid_level(map));
 	printf("        Members : %d\n", map->num_members);
+	printf("          Slots : [");
+	for (i = 0; i < map->num_members; i++) {
+		ord = get_imsm_ord_tbl_ent(dev, i);
+		printf("%s", ord & IMSM_ORD_REBUILD ? "_" : "U");
+	}
+	printf("]\n");
 	slot = get_imsm_disk_slot(map, disk_idx);
 	if (slot >= 0) {
 		ord = get_imsm_ord_tbl_ent(dev, slot);
@@ -4003,6 +4009,17 @@ static int validate_geometry_imsm(struct supertype *st, int level, int layout,
 	close(cfd);
 	return 0;
 }
+
+int default_chunk_imsm(struct supertype *st)
+{
+	struct intel_super *super = st->sb;
+
+	if (!super->orom)
+		return 0;
+
+	return imsm_orom_default_chunk(super->orom);
+}
+
 #endif /* MDASSEMBLE */
 
 static int is_rebuilding(struct imsm_dev *dev)
@@ -4384,6 +4401,7 @@ static int imsm_set_array_state(struct active_array *a, int consistent)
 			dprintf("imsm: mark resync done\n");
 			end_migration(dev, map_state);
 			super->updates_pending++;
+			a->last_checkpoint = 0;
 		}
 	} else if (!is_resyncing(dev) && !failed) {
 		/* mark the start of the init process if nothing is failed */
@@ -4476,17 +4494,20 @@ static void imsm_set_disk(struct active_array *a, int n, int state)
 		map = get_imsm_map(dev, 0);
 		map->failed_disk_num = ~0;
 		super->updates_pending++;
+		a->last_checkpoint = 0;
 	} else if (map_state == IMSM_T_STATE_DEGRADED &&
 		   map->map_state != map_state &&
 		   !dev->vol.migr_state) {
 		dprintf("imsm: mark degraded\n");
 		map->map_state = map_state;
 		super->updates_pending++;
+		a->last_checkpoint = 0;
 	} else if (map_state == IMSM_T_STATE_FAILED &&
 		   map->map_state != map_state) {
 		dprintf("imsm: mark failed\n");
 		end_migration(dev, map_state);
 		super->updates_pending++;
+		a->last_checkpoint = 0;
 	}
 }
 
@@ -5236,6 +5257,7 @@ struct superswitch super_imsm = {
 	.brief_detail_super = brief_detail_super_imsm,
 	.write_init_super = write_init_super_imsm,
 	.validate_geometry = validate_geometry_imsm,
+	.default_chunk	= default_chunk_imsm,
 	.add_to_super	= add_to_super_imsm,
 	.detail_platform = detail_platform_imsm,
 #endif

----
2/ git://github.com/djbw/mdadm.git subarray

This is a reworked version of the volume delete and rename patches posted earlier. The major change, as previously detailed, is disallowing these operations on active containers. If we can get immutable volume-ids in a future version of the metadata, or infrastructure to notify the rest of the OS about the modified UUID(s) perhaps we can revisit this restriction. Two new superswitch methods are added kill_subarray() and update_subarray(). update_subarray() may be useful in the future for changing spare-group identifiers in the metadata.

Dan Williams (2):
Kill subarray
Rename subarray

 Kill.c        |   57 ++++++++++++++++++
 Manage.c      |   48 +++++++++++++++
 ReadMe.c      |    2 +
 mdadm.c       |   47 ++++++++++++++-
 mdadm.h       |   14 ++++-
 mdmon.c       |   25 +-------
 super-ddf.c   |   25 +++++++-
 super-intel.c |  180 +++++++++++++++++++++++++++++++++++++++++++++++++--------
 util.c        |  138 +++++++++++++++++++++++++++++++++++++++++++
 9 files changed, 483 insertions(+), 53 deletions(-)
Kill.c +57 -0

60 lines not on this page · raw message

Manage.c +48 -0

52 lines not on this page · raw message

ReadMe.c +2 -0
index 9d5a211..fa33310 100644
@@ -108,6 +108,8 @@ struct option long_options[] = {
     {"examine-bitmap", 0, 0, 'X'},
     {"auto-detect", 0, 0, AutoDetect},
     {"detail-platform", 0, 0, DetailPlatform},
+    {"kill-subarray", 1, 0, KillSubarray},
+    {"update-subarray", 1, 0, UpdateSubarray},
 
     /* synonyms */
     {"monitor",   0, 0, 'F'},
mdadm.c +45 -2

95 lines not on this page · raw message

mdadm.h +13 -1
index d9d17b0..515da0d 100644
@@ -258,6 +258,7 @@ extern char Version[], Usage[], Help[], OptionHelp[],
 
 /* for option that don't have short equivilents, we assign arbitrary
  * small numbers.  '1' means an undecorated option, so we start at '2'.
+ * (note we must stop before we get to 65 i.e. 'A')
  */
 enum special_options {
 	AssumeClean = 2,
@@ -266,13 +267,15 @@ enum special_options {
 	ReAdd,
 	NoDegraded,
 	Sparc22,
-	BackupFile,
+	BackupFile, /* 8 */
 	HomeHost,
 	AutoHomeHost,
 	Symlinks,
 	AutoDetect,
 	Waitclean,
 	DetailPlatform,
+	KillSubarray,
+	UpdateSubarray, /* 16 */
 };
 
 /* structures read from config file */
@@ -609,6 +612,10 @@ extern struct superswitch {
 	struct mdinfo *(*container_content)(struct supertype *st);
 	/* Allow a metadata handler to override mdadm's default layouts */
 	int (*default_layout)(int level); /* optional */
+	/* Permit subarray's to be deleted from inactive containers */
+	void (*kill_subarray)(struct supertype *st); /* optional */
+	/* Permit subarray's to be modified */
+	int (*update_subarray)(struct supertype *st, char *update, mddev_ident_t ident); /* optional */
 
 /* for mdmon */
 	int (*open_new)(struct supertype *c, struct active_array *a,
@@ -805,6 +812,8 @@ extern int Monitor(mddev_dev_t devlist,
 		   int dosyslog, int test, char *pidfile, int increments);
 
 extern int Kill(char *dev, struct supertype *st, int force, int quiet, int noexcl);
+extern int Kill_subarray(char *dev, char *subarray, int quiet);
+extern int Update_subarray(char *dev, char *subarray, char *update, mddev_ident_t ident, int quiet);
 extern int Wait(char *dev);
 extern int WaitClean(char *dev, int sock, int verbose);
 
@@ -911,6 +920,9 @@ extern int create_mddev(char *dev, char *name, int autof, int trustworthy,
 #define	METADATA 3
 extern int open_mddev(char *dev, int report_errors);
 extern int open_container(int fd);
+extern int is_container_member(struct mdstat_ent *ent, char *devname);
+extern int open_subarray(char *dev, struct supertype *st, int quiet);
+extern struct superswitch *version_to_superswitch(char *vers);
 
 extern char *pid_dir;
 extern int mdmon_running(int devnum);
mdmon.c +2 -23
index 69c320e..beb39cf 100644
@@ -104,15 +104,6 @@ int __clone2(int (*fn)(void *),
 	return mon_tid;
 }
 
-static struct superswitch *find_metadata_methods(char *vers)
-{
-	if (strcmp(vers, "ddf") == 0)
-		return &super_ddf;
-	if (strcmp(vers, "imsm") == 0)
-		return &super_imsm;
-	return NULL;
-}
-
 static int make_pidfile(char *devname)
 {
 	char path[100];
@@ -136,18 +127,6 @@ static int make_pidfile(char *devname)
 	return 0;
 }
 
-int is_container_member(struct mdstat_ent *mdstat, char *container)
-{
-	if (mdstat->metadata_version == NULL ||
-	    strncmp(mdstat->metadata_version, "external:", 9) != 0 ||
-	    !is_subarray(mdstat->metadata_version+9) ||
-	    strncmp(mdstat->metadata_version+10, container, strlen(container)) != 0 ||
-	    mdstat->metadata_version[10+strlen(container)] != '/')
-		return 0;
-
-	return 1;
-}
-
 static void try_kill_monitor(pid_t pid, char *devname, int sock)
 {
 	char buf[100];
@@ -414,9 +393,9 @@ static int mdmon(char *devname, int devnum, int must_fork, int takeover)
 		exit(3);
 	}
 
-	container->ss = find_metadata_methods(mdi->text_version);
+	container->ss = version_to_superswitch(mdi->text_version);
 	if (container->ss == NULL) {
-		fprintf(stderr, "mdmon: %s uses unknown metadata: %s\n",
+		fprintf(stderr, "mdmon: %s uses unsupported metadata: %s\n",
 			devname, mdi->text_version);
 		exit(3);
 	}
super-ddf.c +22 -3
index 0e6f1e5..736e07f 100644
@@ -845,10 +845,18 @@ static int load_super_ddf(struct supertype *st, int fd,
 	}
 
 	if (st->subarray[0]) {
+		unsigned long val;
 		struct vcl *v;
+		char *ep;
+
+		val = strtoul(st->subarray, &ep, 10);
+		if (*ep != '\0') {
+			free(super);
+			return 1;
+		}
 
 		for (v = super->conflist; v; v = v->next)
-			if (v->vcnum == atoi(st->subarray))
+			if (v->vcnum == val)
 				super->currentconf = v;
 		if (!super->currentconf) {
 			free(super);
@@ -2870,14 +2878,25 @@ static int load_super_ddf_all(struct supertype *st, int fd,
 			return 1;
 	}
 	if (st->subarray[0]) {
+		unsigned long val;
 		struct vcl *v;
+		char *ep;
+
+		val = strtoul(st->subarray, &ep, 10);
+		if (*ep != '\0') {
+			free(super);
+			return 1;
+		}
 
 		for (v = super->conflist; v; v = v->next)
-			if (v->vcnum == atoi(st->subarray))
+			if (v->vcnum == val)
 				super->currentconf = v;
-		if (!super->currentconf)
+		if (!super->currentconf) {
+			free(super);
 			return 1;
+		}
 	}
+
 	*sbp = super;
 	if (st->ss == NULL) {
 		st->ss = &super_ddf;
super-intel.c +156 -24

230 lines not on this page · raw message

util.c +138 -0

144 lines not on this page · raw message

----
3/ git://github.com/djbw/mdadm.git hotplug

This branch addresses a long standing problem with imsm incremental assembly. The current count_active() and enough() routines are unable to capture all the corner cases of determining when a container is ready to be assembled, so I add a ->container_enough flag to allow external metadata handlers to self report. Note that I punted on ddf. This now does the 'right thing' when hot plugging various members of a raid10 array i.e. like allow -R when one of each mirror has arrived, and catch single-degraded to double-degraded transitions.

Dan Williams (2):
Incremental: honor an 'enough' flag from external handlers Revert "Incremental: honor --no-degraded to delay assembly"

 Incremental.c |   14 ++++++--
 mdadm.8       |    5 ---
 mdadm.c       |    1 -
 mdadm.h       |    4 ++-
 super-ddf.c   |    1 +
 super-intel.c |   99 +++++++++++++++++++++++++++++++++++++++++++++-----------
 6 files changed, 93 insertions(+), 31 deletions(-)
Incremental.c +10 -4
index 7ad648a..d6dd0f4 100644
@@ -258,6 +258,15 @@ int Incremental(char *devname, int verbose, int runstop,
 		autof = ci->autof;
 
 	if (st->ss->container_content && st->loaded_container) {
+		if ((runstop > 0 && info.container_enough >= 0) ||
+		    info.container_enough > 0)
+			/* pass */;
+		else {
+			if (verbose)
+				fprintf(stderr, Name ": not enough devices to start the container\n");
+			return 1;
+		}
+
 		/* This is a pre-built container array, so we do something
 		 * rather different.
 		 */
@@ -428,8 +437,6 @@ int Incremental(char *devname, int verbose, int runstop,
 				chosen_name, info.array.working_disks);
 		wait_for(chosen_name, mdfd);
 		close(mdfd);
-		if (runstop < 0)
-			return 0; /* don't try to assemble */
 		rv = Incremental(chosen_name, verbose, runstop,
 				 NULL, homehost, require_homehost, autof);
 		if (rv == 1)
@@ -443,8 +450,7 @@ int Incremental(char *devname, int verbose, int runstop,
 	active_disks = count_active(st, mdfd, &avail, &info);
 	if (enough(info.array.level, info.array.raid_disks,
 		   info.array.layout, info.array.state & 1,
-		   avail, active_disks) == 0 ||
-	    (runstop < 0 && active_disks < info.array.raid_disks)) {
+		   avail, active_disks) == 0) {
 		free(avail);
 		if (verbose >= 0)
 			fprintf(stderr, Name
mdadm.8 +0 -5
index 4edfc41..90470d9 100644
@@ -1219,11 +1219,6 @@ Run any array assembled as soon as a minimal number of devices are
 available, rather than waiting until all expected devices are present.
 
 .TP
-.B \-\-no\-degraded
-This allows the hot-plug system to prevent arrays from running when it knows
-that more disks may arrive later in the discovery process.
-
-.TP
 .BR \-\-scan ", " \-s
 Only meaningful with
 .B \-R
mdadm.c +0 -1
index d5e34c0..a401be2 100644
@@ -671,7 +671,6 @@ int main(int argc, char *argv[])
 		"     'summaries', 'homehost', 'byteorder', 'devicesize'.\n");
 			exit(outf == stdout ? 0 : 2);
 
-		case O(INCREMENTAL,NoDegraded):
 		case O(ASSEMBLE,NoDegraded): /* --no-degraded */
 			runstop = -1; /* --stop isn't allowed for --assemble,
 				       * so we overload slightly */
mdadm.h +3 -1
index d9d17b0..a0797e8 100644
@@ -205,7 +205,9 @@ struct mdinfo {
 	int container_member; /* for assembling external-metatdata arrays
 			       * This is to be used internally by metadata
 			       * handler only */
-
+	int container_enough; /* flag external handlers can set to
+			       * indicate that subarrays have not enough (-1),
+			       * enough to start (0), or all expected disks (1) */
 	char 		sys_name[20];
 	struct mdinfo *devs;
 	struct mdinfo *next;
super-ddf.c +1 -0
index 0e6f1e5..b01c68d 100644
@@ -1357,6 +1357,7 @@ static void getinfo_super_ddf(struct supertype *st, struct mdinfo *info)
 							 (ddf->anchor.guid+16));
 	info->array.utime	  = 0;
 	info->array.chunk_size	  = 0;
+	info->container_enough	  = 0;
 
 
 	info->disk.major = 0;
super-intel.c +79 -20

135 lines not on this page · raw message

----
4/ git://github.com/djbw/mdadm.git fixes

Miscellaneous fixes.

Dan Williams (1):
imsm: robustify recovery-start detection

Przemyslaw Hawrylewicz Czarnowski (1):
fix: memory leak in mdmon_pid()

 super-intel.c |    9 +++++++++
 util.c        |    6 +++++-
 2 files changed, 14 insertions(+), 1 deletions(-)
super-intel.c +9 -0
index bdd7a96..dd9699d 100644
@@ -4044,6 +4044,15 @@ static void update_recovery_start(struct imsm_dev *dev, struct mdinfo *array)
 			rebuild = d;
 		}
 
+	if (!rebuild) {
+		/* (?) none of the disks are marked with
+		 * IMSM_ORD_REBUILD, so assume they are missing and the
+		 * disk_ord_tbl was not correctly updated
+		 */
+		dprintf("%s: failed to locate out-of-sync disk\n", __func__);
+		return;
+	}
+
 	units = __le32_to_cpu(dev->vol.curr_migr_unit);
 	rebuild->recovery_start = units * blocks_per_migr_unit(dev);
 }
util.c +5 -1
index 25f1e56..8315200 100644
@@ -1532,7 +1532,11 @@ int mdmon_pid(int devnum)
 	char pid[10];
 	int fd;
 	int n;
-	sprintf(path, "%s/%s.pid", pid_dir, devnum2devname(devnum));
+	char *devname = devnum2devname(devnum);
+
+	sprintf(path, "%s/%s.pid", pid_dir, devname);
+	free(devname);
+
 	fd = open(path, O_RDONLY | O_NOATIME, 0);
 
 	if (fd < 0)
#1 lore raw
Quoted 11 lines · On Wed, 26 May 2010 17:50:52 -0700 Dan Williams <[email protected]>…

Hi Neil,

A collection of updates that have been separated onto individual topic branches. I provide a url, summary, and full diff for each topic if you want to do piecemeal pulls, otherwise the merged set is available here:

git://github.com/djbw/mdadm.git master

Dan Williams (10):
mdmon: fix missing open of md/<dev>/recovery_start
mdmon: periodically checkpoint recovery

I don't understand why you write 'idle' to 'sync_action' here. It should not be needed.
Shouldn't we just be listening for events on sync_completed, and write them to the metadata??

Quoted 2 lines

imsm: dump each disk's view of the slot state Kill subarray

I assume that this is only allowed on an idle container because the volume index number of subsequent volumes will change, and as that is used in the uuid the uuid will change, and that is bad.
1/ Can you leave a 'place-holder' empty volume in the list, that a subsequent
create can use?
2/ As ddf doesn't suffer from this issue, the test for 'active volume that
will get a new uuid' should be in the super-intel code. And it should be exactly that test - if earlier volumes are active, that should not be a problem.
Maybe a new method "safe_to_delete_volume".... or something.

Also: -ENODOC.

Quoted 1 line

Rename subarray

Rename will change the uuid of the renamed array, but not the uuid of anything else, so it should be allowed if just the volume is inactive.

Also it would be nicer if you factored out open_subarray in the previous patch, but that isn't a big issue (I would still accept if that was the only issue).

Quoted 4 lines

Incremental: honor an 'enough' flag from external handlers Revert "Incremental: honor --no-degraded to delay assembly" Merge branch 'subarray' into for-neil
imsm: robustify recovery-start detection

"robistify" !! Is that a neologism ??

I've merged and pushed out the other bits which all seem OK.

Thanks,
NeilBrown

#2 lore raw
Quoted 11 lines · Neil Brown
Quoted 8 lines · On Wed, 26 May 2010 17:50:52 -0700 Dan Williams <[email protected]>…

Hi Neil,

A collection of updates that have been separated onto individual topic branches.  I provide a url, summary, and full diff for each topic if you want to do piecemeal pulls, otherwise the merged set is available here:

      git://github.com/djbw/mdadm.git master

Quoted 8 lines
Quoted 3 lines

Dan Williams (10):
      mdmon: fix missing open of md/<dev>/recovery_start
      mdmon: periodically checkpoint recovery

I don't understand why you write 'idle' to 'sync_action' here. It should not be needed.
Shouldn't we just be listening for events on sync_completed, and write them to the metadata??

This was an attempt to re-use the same mechanism for intermediate checkpointing as array-shutdown checkpointing.

We currently checkpoint from md/resync_start and md/dev/recovery_start at sync_action == idle, but I will append a fix up patch to use ->last_checkpoint whenever is_resync_complete() is false.

By the way... listening for sync_completed events will fix a bug with handling the write-pending event. I have hit occasions, and others have too [1], where the system locks up while resyncing. I believe it is because the wakeup of the blocked thread in md_write_start() races with the sync thread doing a notification for a checkpoint. I'll try to verify that the lockup goes away when polling sync_completed, but I'm fairly certain that is the bug.

Quoted 7 lines
Quoted 3 lines

      imsm: dump each disk's view of the slot state Kill subarray

I assume that this is only allowed on an idle container because the volume index number of subsequent volumes will change, and as that is used in the uuid the uuid will change, and that is bad.

Yes.

Quoted 2 lines

1/ Can you leave a 'place-holder' empty volume in the list, that a subsequent create can use?

No, this would confuse the option-rom.

Quoted 4 lines

2/ As ddf doesn't suffer from this issue, the test for 'active volume that will get a new uuid' should be in the super-intel code.  And it should be exactly that test - if earlier volumes are active, that should not be a problem.

Ok, this also needs communication with mdmon for the active case, I'll add that.

Quoted 1 line

  Maybe a new method "safe_to_delete_volume".... or something.

I think we can just fail the delete in the handler. It also appears like we will be getting a unique identifier in a future update to the metadata. It will have a flag so that we can safely decide "use old synthesized value" versus "use new stable/recorded value".

Quoted 1 line

Also:  -ENODOC.

Yeah, this was a rewrite of an earlier attempt so wanted to make sure it was going in the right direction. Will add.

Quoted 5 lines
Quoted 2 lines

      Rename subarray

Rename will change the uuid of the renamed array, but not the uuid of anything else, so it should be allowed if just the volume is inactive.

Like above need to close the loop with mdmon.

Quoted 4 lines

Also it would be nicer if you factored out open_subarray in the previous patch, but that isn't a big issue (I would still accept if that was the only issue).

Ok, I'll keep that in mind for next time.

Quoted 8 lines
Quoted 6 lines

      Incremental: honor an 'enough' flag from external handlers Revert "Incremental: honor --no-degraded to delay assembly" Merge branch 'subarray' into for-neil
      imsm: robustify recovery-start detection

"robistify" !! Is that a neologism ??

;-) right up there with "borkage".

Quoted 1 line

I've merged and pushed out the other bits which all seem OK.

Ok, there was one more you didn't comment on and didn't cherry-pick [2]

Dave Jiang (1):
create: Check with OROM limit before setting default chunk size

Thanks,
Dan

[1]: https://bugzilla.redhat.com/show_bug.cgi?id=602457
[2]: http://git.kernel.org/?p=linux/kernel/git/djbw/mdadm.git;a=commitdiff;h=f8cde132
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw
Quoted 9 lines · On Thu, 10 Jun 2010 23:42:16 -0700 Dan Williams <[email protected]>…
Quoted 1 line

I've merged and pushed out the other bits which all seem OK.

Ok, there was one more you didn't comment on and didn't cherry-pick [2]

Dave Jiang (1):
create: Check with OROM limit before setting default chunk size

Thanks,
Dan

I don't remember seeing that before - sorry.
It looks OK. It might be nice to combine it with the ->default_layout setting somehow, but that isn't necessary in the first instance.

Include it in the next pull request and I'll take it.

Thanks,
NeilBrown

#4 lore raw
Quoted 10 lines · Neil Brown
Quoted 7 lines · On Thu, 10 Jun 2010 23:42:16 -0700 Dan Williams <[email protected]>…
Quoted 1 line

I've merged and pushed out the other bits which all seem OK.

Ok, there was one more you didn't comment on and didn't cherry-pick [2]

Dave Jiang (1):
create: Check with OROM limit before setting default chunk size

Quoted 9 lines
Quoted 2 lines

Thanks,
Dan

I don't remember seeing that before - sorry.
It looks OK. It might be nice to combine it with the ->default_layout setting somehow, but that isn't necessary in the first instance.

Include it in the next pull request and I'll take it.

Here is the updated pull request:

The following changes since commit b3b4e8a7a229cccca915421329a5319f996b0842:
NeilBrown (1):
Avoid skipping devices where removing all faulty/detached devices.

are available in the git repository at:

git://github.com/djbw/mdadm.git master

Dan Williams (10):
mdmon: periodically checkpoint recovery
Kill subarray v2
imsm: dump each disk's view of the slot state
mdmon: record sync_completed directly to the metadata Remove 'checkpointing' side effect of --wait-clean Always assume SKIP_GONE_DEVS behaviour and kill the flag Rename subarray v2
mdmon: prevent allocations due to late binding Merge branch 'subarray' into for-neil
Merge branch 'fixes' into for-neil

Dave Jiang (1):
create: Check with OROM limit before setting default chunk size

Changes since the last request:
1/ pushed down killsubarray and rename subarray restrictions (changing uuid of active arrays) into super-intel.c

2/ Updated rebuild checkpointing to directly record sync_completed in the metadata. Monitoring sync_completed is urgently needed to fix address a known hang triggered by ignoring sync_completed events.

3/ Made SKIP_GONE_DEVS the default to address any remaining sigsevs from not expecting the return value of sysfs_read to be null (Dave triggered one in Incremental.c)

4/ A fixlet for a theoretical problem of the monitor thread doing late binding at the wrong time. Also happens to workaround the glibc tls problem that causes mdmon to intermittently fail to load. Still waiting for feedback from the glibc folks on whether they can provide a helper or automatically set up their expected tls area when an app does not specify the CLONE_SETTLS flag to clone(2).

The per topic branch names are 'checkpoint', 'fixes', and 'subarray' if you want to take these piecemeal.

 Create.c         |    8 +-
 Grow.c           |   20 ++-
 Incremental.c    |    5 +
 Kill.c           |   78 +++++++++++++
 Makefile         |    3 +-
 Manage.c         |   53 +++++++++
 ReadMe.c         |    2 +
 managemon.c      |    3 +-
 mapfile.c        |    5 +-
 mdadm.8.in       |   47 +++++++-
 mdadm.c          |   47 ++++++++-
 mdadm.h          |   18 +++-
 mdmon.c          |   28 +----
 mdmon.h          |    9 ++
 monitor.c        |   37 ++++++
 platform-intel.h |   49 ++++++++
 super-ddf.c      |   33 ++++--
 super-intel.c    |  333 ++++++++++++++++++++++++++++++++++++++++++++++++------
 sysfs.c          |   23 ++---
 util.c           |  137 ++++++++++++++++++++++
 20 files changed, 831 insertions(+), 107 deletions(-)

commit d19e3cfb6627c40e3a28454ebc2098c0e19b9a77
Merge: 8cfc801 23eb475
Author: Dan Williams <[email protected]>
Date: Thu Jul 1 17:36:11 2010 -0700

Merge branch 'fixes' into for-neil

commit 8cfc801c72f079618b39d04c2e0fe32adbc2474e
Merge: 6a0ee6a aa53467
Author: Dan Williams <[email protected]>
Date: Thu Jul 1 17:36:05 2010 -0700

Merge branch 'subarray' into for-neil

Conflicts:
mdadm.h
super-intel.c

commit 23eb475a96b1b0cf7f8feaeb7b32355b80e8faa7

Author: Dan Williams <[email protected]>
Date:   Thu Jul 1 17:28:14 2010 -0700

mdmon: prevent allocations due to late binding

Current versions of glibc do not provide a useable interface to clone(2) as it inflicts hidden dependencies on setting up a glibc specific tls descriptor. The dynamic linker trips this dependency and causes mdmon to intermittently fail to load. Resolving all dynamic linking prior to starting the monitor thread appears to mitigate the issue but there is no guarantee that another tls dependency will bite us later.

However, while the debate continues with the glibc maintainers it seems prudent to keep this change. It ensures that we do not get into a situation where the monitor thread needs to make a late allocation to resolve a symbol.

commit aa534678baad80689a642ba1bd602a00a267ac03

Author: Dan Williams <[email protected]>
Date:   Tue Jun 22 16:30:59 2010 -0700

Rename subarray v2

Allow the name of the array stored in the metadata to be updated. In some cases the metadata format may not be able to support this rename without modifying the UUID. In these cases the request will be blocked. Otherwise we allow the rename to take place, even for active arrays. This assumes that the user understands the difference between the kernel node name, the device node symlink name, and the metadata specific name.

Anticipating further need to modify subarrays in-place, introduce the ->update_subarray() superswitch method. A future potential use case is setting storage pool (spare-group) identifiers.

commit b526e52dc7cbdde98db9c9f8765be28ba6d71d78

Author: Dan Williams <[email protected]>
Date:   Wed Jun 16 17:26:04 2010 -0700

Always assume SKIP_GONE_DEVS behaviour and kill the flag

...i.e. GET_DEVS == (GET_DEVS|SKIP_GONE_DEVS)

A null pointer dereference in Incremental.c can be triggered by replugging a disk while the old name is in use. When mdadm -I is called on the new disk we fail the call to sysfs_read(). I audited all the locations that use GET_DEVS and it appears they can tolerate missing a drive. So just make SKIP_GONE_DEVS the default behaviour.

Also fix up remaining unchecked usages of the sysfs_read() return value.

commit 6a0ee6a0770e8b2ae2a2bbe79896d4ecb083e218

Author: Dan Williams <[email protected]>
Date:   Tue Jun 15 18:41:57 2010 -0700

Remove 'checkpointing' side effect of --wait-clean

Now that mdmon records periodic checkpoints, and checkpoints every ->set_array_state() event we no longer need to 'idle' sync_action from --wait-clean.

commit 4f0a7acc9a0a93d39b66b29e374f9a5edd173047

Author: Dan Williams <[email protected]>
Date:   Tue Jun 15 18:41:57 2010 -0700

mdmon: record sync_completed directly to the metadata

When sync_action is idle mdmon takes the latest value of md/resync_start or md/<dev>/recovery_start to record the resync/rebuild checkpoint in the metadata. However, now that mdmon is reading sync_completed there is no longer a need to wait for, or force an idle event to take a checkpoint.

Simply update the forward progress of ->last_checkpoint at every wakeup event and force it to be recorded at least every 1/16th array-size interval. It may be recorded more frequently if a ->set_array_state() event occurs.

This also cleans up some confusion in handling the dual-rebuild case. If more than one spare has been activated the kernel starts the rebuild at the lowest recovery offset, so we do not need to worry about min_recovery_start().

commit 0d80bb2f97e876379fb0ba732e8e97894ebe3de9

Author: Dan Williams <[email protected]>
Date:   Tue Jun 15 18:41:57 2010 -0700

imsm: dump each disk's view of the slot state

Allow --examine to determine which disk might have a stale view of the per-disk out-of-sync state.

commit 0bd16cf2173695726f1ed2f9372c613003d80f9a

Author: Dave Jiang <[email protected]>
Date:   Tue Jun 15 18:41:53 2010 -0700

create: Check with OROM limit before setting default chunk size

Make create check with the appropriate meta data handler and see what the largest chunk size is supported. The current 512K default is not supported by existing imsm OROM.

[[email protected]: trim the upper limit to 512k for future oroms]

commit 33414a0182ae193150f65f7bca97a7e4d818a49e

Author: Dan Williams <[email protected]>
Date:   Tue Jun 15 17:55:41 2010 -0700

Kill subarray v2

Support for deleting a subarray out of a container. When all subarrays are deleted the component devices are converted back into spares, a --zero-superblock is still needed to kill the remaining metadata at this point. This operation is blocked when the subarray is active and may also be blocked by the metadata handler when deleting the subarray might change the uuid of other active subarrays. For example, with imsm, deleting subarray 'n' may change the uuid of subarrays with indexes > n.

Deleting a subarray needs to be a container wide event to ensure disks that record the modified subarray list perceive other disks that did not receive this change as out of date.

Notes:
The st->subarray parsing in super-intel.c and super-ddf.c is updated to be more strict now that we are reading user supplied subarray values.

Offline container modification shares actions that mdmon typically handles so promote is_container_member() and version_to_superswitch() (formerly find_metadata_methods()) to generic utility functions for the cases where mdadm performs the operation.

commit 484240d8a3facde992009efd81bfa4cc0c79287d

Author: Dan Williams <[email protected]>
Date:   Fri May 14 17:42:49 2010 -0700

mdmon: periodically checkpoint recovery

The kernel updates and notifies md/sync_completed when it is time to take a checkpoint. When this occurs (at 1/16 array size intervals) write 'idle' to md/sync_action to have the current recovery position updated in recovery_start and resync_start.

Requires the metadata handler to reset ->last_checkpoint when it has determined that recovery has ended.

#5 lore raw
Quoted 43 lines · On Thu, 01 Jul 2010 17:56:51 -0700 Dan Williams <[email protected]>…
Quoted 10 lines · Neil Brown
Quoted 7 lines · On Thu, 10 Jun 2010 23:42:16 -0700 Dan Williams <[email protected]>…
Quoted 1 line

I've merged and pushed out the other bits which all seem OK.

Ok, there was one more you didn't comment on and didn't cherry-pick [2]

Dave Jiang (1):
create: Check with OROM limit before setting default chunk size

Quoted 9 lines
Quoted 2 lines

Thanks,
Dan

I don't remember seeing that before - sorry.
It looks OK. It might be nice to combine it with the ->default_layout setting somehow, but that isn't necessary in the first instance.

Include it in the next pull request and I'll take it.

Here is the updated pull request:

The following changes since commit b3b4e8a7a229cccca915421329a5319f996b0842:
NeilBrown (1):
Avoid skipping devices where removing all faulty/detached devices.

are available in the git repository at:

git://github.com/djbw/mdadm.git master

Dan Williams (10):
mdmon: periodically checkpoint recovery
Kill subarray v2
imsm: dump each disk's view of the slot state
mdmon: record sync_completed directly to the metadata Remove 'checkpointing' side effect of --wait-clean Always assume SKIP_GONE_DEVS behaviour and kill the flag Rename subarray v2
mdmon: prevent allocations due to late binding Merge branch 'subarray' into for-neil
Merge branch 'fixes' into for-neil

Quoted 2 lines

Dave Jiang (1):
create: Check with OROM limit before setting default chunk size

Thanks. They all look credible.
I have pulled and pushed so you can find them in
git://neil.brown.name/mdadm master

I'm fairly seriously considering cutting a 3.1.3 shortly (Thursday?) so that I have a clean slate to build the policy frame work and aim it for 3.2.0.

If you have anything that you would like to see included in (or addressed for) 3.1.3, please let me know.

Thanks,
NeilBrown

#6 lore raw

fixes for 3.1.3 (was: Re: [mdadm GIT PULL] rebuild checkpoints...)

Quoted 6 lines · Neil Brown

I'm fairly seriously considering cutting a 3.1.3 shortly (Thursday?) so that I have a clean slate to build the policy frame work and aim it for 3.2.0.

If you have anything that you would like to see included in (or addressed for) 3.1.3, please let me know.

The pthread_create() vs clone(2) issue is still being discussed, but in the meantime using pthreads seems the safe thing to do. So, here is that implementation and another trivial build-warning fixup.

The following changes since commit 1538aca5cbbd99be47657e0ca0b7e2186426a1b1:
NeilBrown (1):
Merge branch 'master' of git://github.com/djbw/mdadm

are available in the git repository at:

git://github.com/djbw/mdadm.git master

Dan Williams (2):
mdmon: satisfy glibc tls abi requirements with pthreads
imsm: fix a -O2 build warning

 Makefile      |   14 +++++++++++---
 mdmon.c       |   42 +++++++++++++++++++++++++++++++++++++++---
 super-intel.c |    4 ++--
 3 files changed, 52 insertions(+), 8 deletions(-)

commit f4190c2f12527e37304f7c185afa0449fa9dee1c

Author: Dan Williams <[email protected]>
Date:   Tue Jul 6 12:48:56 2010 -0700

mdmon: satisfy glibc tls abi requirements with pthreads

Setting up a proper tls descriptor is required to conform to the abi [1]. Until it can be implemented in mdmon use pthreads instead of clone(2) to let glibc handle the details. The old behaviour can be had by un-defining USE_PTHREADS.

Note, the "O2" builds need LDFLAGS now to pick up the '-pthread' option.

[1]: http://people.redhat.com/drepper/tls.pdf

Makefile +11 -3
index 237f4fc..0f42f88 100644
@@ -75,6 +75,14 @@ ALTFLAGS = -DALT_RUN=\"$(ALT_RUN)\" -DALT_MAPFILE=\"$(ALT_MAPFILE)\"
 VARFLAGS = -DVAR_RUN=\"$(VAR_RUN)\"
 CFLAGS = $(CWFLAGS) $(CXFLAGS) -DSendmail=\""$(MAILCMD)"\" $(CONFFILEFLAGS) $(ALTFLAGS) $(VARFLAGS)
 
+# The glibc TLS ABI requires applications that call clone(2) to set up
+# TLS data structures, use pthreads until mdmon implements this support
+USE_PTHREADS = 1
+ifdef USE_PTHREADS
+CFLAGS += -DUSE_PTHREADS
+LDFLAGS += -pthread
+endif
+
 # If you want a static binary, you might uncomment these
 # LDFLAGS = -static
 # STRIP = -s
@@ -149,13 +157,13 @@ mdadm.klibc : $(SRCS) mdadm.h
 	$(CC) -nostdinc -iwithprefix include -I$(KLIBC)/klibc/include -I$(KLIBC)/linux/include -I$(KLIBC)/klibc/arch/i386/include -I$(KLIBC)/klibc/include/bits32 $(CFLAGS) $(SRCS)
 
 mdadm.Os : $(SRCS) mdadm.h
-	$(CC) -o mdadm.Os $(CFLAGS)  -DHAVE_STDINT_H -Os $(SRCS)
+	$(CC) -o mdadm.Os $(CFLAGS) $(LDFLAGS) -DHAVE_STDINT_H -Os $(SRCS)
 
 mdadm.O2 : $(SRCS) mdadm.h mdmon.O2
-	$(CC) -o mdadm.O2 $(CFLAGS)  -DHAVE_STDINT_H -O2 -D_FORTIFY_SOURCE=2 $(SRCS)
+	$(CC) -o mdadm.O2 $(CFLAGS) $(LDFLAGS) -DHAVE_STDINT_H -O2 -D_FORTIFY_SOURCE=2 $(SRCS)
 
 mdmon.O2 : $(MON_SRCS) mdadm.h mdmon.h
-	$(CC) -o mdmon.O2 $(CFLAGS)  -DHAVE_STDINT_H -O2 -D_FORTIFY_SOURCE=2 $(MON_SRCS)
+	$(CC) -o mdmon.O2 $(CFLAGS) $(LDFLAGS) -DHAVE_STDINT_H -O2 -D_FORTIFY_SOURCE=2 $(MON_SRCS)
 
 # use '-z now' to guarantee no dynamic linker interactions with the monitor thread
 mdmon : $(MON_OBJS)
mdmon.c +39 -3

67 lines not on this page · raw message

commit 569cc43ffb0634510defee91407d261555c7a991

Author: Dan Williams <[email protected]>
Date:   Tue Jul 6 12:48:59 2010 -0700

imsm: fix a -O2 build warning

super-intel.c: In function ‘imsm_add_spare’:
super-intel.c:4833: error: ‘array_start’ may be used uninitialized in this function super-intel.c:4834: error: ‘array_end’ may be used uninitialized in this function

This is valid, if we don't find a spare candidate then array_{start,end} will be uninitialized.

super-intel.c +2 -2
index daf811f..6826d9b 100644
@@ -4830,8 +4830,8 @@ static struct dl *imsm_add_spare(struct intel_super *super, int slot,
 	struct extent *ex;
 	int i, j;
 	int found;
-	__u32 array_start;
-	__u32 array_end;
+	__u32 array_start = 0;
+	__u32 array_end = 0;
 	struct dl *dl;
 
 	for (dl = super->disks; dl; dl = dl->next) {

--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#7 lore raw

Re: fixes for 3.1.3 (was: Re: [mdadm GIT PULL] rebuild checkpoints...)

Quoted 4 lines · Dan J
Quoted 3 lines · Neil Brown

I'm fairly seriously considering cutting a 3.1.3 shortly (Thursday?) so that I have a clean slate to build the policy frame work and aim it for 3.2.0.

Quoted 8 lines
Quoted 3 lines

If you have anything that you would like to see included in (or addressed for) 3.1.3, please let me know.

The pthread_create() vs clone(2) issue is still being discussed, but in the meantime using pthreads seems the safe thing to do. So, here is that implementation and another trivial build-warning fixup.

I've appended a patch to repair external metadata incremental assembly that was broken by commit 3a6ec29a "Don't let incremental add devices to active arrays." So the pull request is now:

The following changes since commit 50526e9090d0c118b065840719bc9601be8af8b8:
NeilBrown (1):
super-0.90: don't write bitmap larger than 60K

are available in the git repository at:

git://github.com/djbw/mdadm.git master

Dan Williams (3):
mdmon: satisfy glibc tls abi requirements with pthreads
imsm: fix a -O2 build warning
Incremental: restore assembly for inactive containers, block active

 Incremental.c |   11 ++++++++++-
 Makefile      |   14 +++++++++++---
 mdadm.h       |    1 +
 mdmon.c       |   42 +++++++++++++++++++++++++++++++++++++++---
 super-intel.c |    4 ++--
 util.c        |    7 ++++++-
 6 files changed, 69 insertions(+), 10 deletions(-)

---
Incremental: restore assembly for inactive containers, block active

GET_ARRAY_INFO always succeeds on an inactive container, so we need to be a bit more diligent about adding a disk to an active container.

---

 Incremental.c |   11 ++++++++++-
 mdadm.h       |    1 +
 util.c        |    7 ++++++-
 3 files changed, 17 insertions(+), 2 deletions(-)
Incremental.c +10 -1
index 96bfcec..abfea24 100644
@@ -376,7 +376,16 @@ int Incremental(char *devname, int verbose, int runstop,
 		 * statement about this.
 		 */
 		if (runstop < 1) {
-			if (ioctl(mdfd, GET_ARRAY_INFO, &ainf) == 0) {
+			int active = 0;
+			
+			if (st->ss->external) {
+				char *devname = devnum2devname(fd2devnum(mdfd));
+
+				active = devname && is_container_active(devname);
+				free(devname);
+			} else if (ioctl(mdfd, GET_ARRAY_INFO, &ainf) == 0)
+				active = 1;
+			if (active) {
 				fprintf(stderr, Name
 					": not adding %s to active array (without --run) %s\n",
 					devname, chosen_name);
mdadm.h +1 -0
index 55e9e46..f1fe24f 100644
@@ -930,6 +930,7 @@ extern int open_mddev(char *dev, int report_errors);
 extern int open_container(int fd);
 extern int is_container_member(struct mdstat_ent *ent, char *devname);
 extern int is_subarray_active(char *subarray, char *devname);
+int is_container_active(char *devname);
 extern int open_subarray(char *dev, struct supertype *st, int quiet);
 extern struct superswitch *version_to_superswitch(char *vers);
 
util.c +6 -1
index d22b0d0..1ce6a7a 100644
@@ -1427,7 +1427,7 @@ int is_subarray_active(char *subarray, char *container)
 		if (is_container_member(ent, container)) {
 			char *inst = &ent->metadata_version[10+strlen(container)+1];
 
-			if (strcmp(inst, subarray) == 0)
+			if (!subarray || strcmp(inst, subarray) == 0)
 				break;
 		}
 	}
@@ -1437,6 +1437,11 @@ int is_subarray_active(char *subarray, char *container)
 	return ent != NULL;
 }
 
+int is_container_active(char *container)
+{
+	return is_subarray_active(NULL, container);
+}
+
 /* open_subarray - opens a subarray in a container
  * @dev: container device name
  * @st: supertype with only ->subarray set
#8 lore raw

Re: fixes for 3.1.3 (was: Re: [mdadm GIT PULL] rebuild checkpoints...)

Quoted 22 lines · On Wed, 21 Jul 2010 11:04:04 -0700 Dan Williams <[email protected]>…
Quoted 4 lines · Dan J
Quoted 3 lines · Neil Brown

I'm fairly seriously considering cutting a 3.1.3 shortly (Thursday?) so that I have a clean slate to build the policy frame work and aim it for 3.2.0.

Quoted 8 lines
Quoted 3 lines

If you have anything that you would like to see included in (or addressed for) 3.1.3, please let me know.

The pthread_create() vs clone(2) issue is still being discussed, but in the meantime using pthreads seems the safe thing to do. So, here is that implementation and another trivial build-warning fixup.

I've appended a patch to repair external metadata incremental assembly that was broken by commit 3a6ec29a "Don't let incremental add devices to active arrays." So the pull request is now:

The following changes since commit 50526e9090d0c118b065840719bc9601be8af8b8:
NeilBrown (1):
super-0.90: don't write bitmap larger than 60K

Quoted 8 lines

are available in the git repository at:

git://github.com/djbw/mdadm.git master

Dan Williams (3):
mdmon: satisfy glibc tls abi requirements with pthreads
imsm: fix a -O2 build warning
Incremental: restore assembly for inactive containers, block active

Thanks - pulled and pushed out.

I'm not going to get to 3.1.3 today after all - too many other things happened this week.

But I'm really hoping for next week....

NeilBrown

#9 lore raw
In reply to Neil Brown
Quoted 54 lines · Neil Brown
Quoted 43 lines · On Thu, 01 Jul 2010 17:56:51 -0700 Dan Williams <[email protected]>…
Quoted 10 lines · Neil Brown
Quoted 7 lines · On Thu, 10 Jun 2010 23:42:16 -0700 Dan Williams <[email protected]>…
Quoted 1 line

I've merged and pushed out the other bits which all seem OK.

Ok, there was one more you didn't comment on and didn't cherry-pick [2]

Dave Jiang (1):
create: Check with OROM limit before setting default chunk size

Quoted 9 lines
Quoted 2 lines

Thanks,
Dan

I don't remember seeing that before - sorry.
It looks OK. It might be nice to combine it with the ->default_layout setting somehow, but that isn't necessary in the first instance.

Include it in the next pull request and I'll take it.

Here is the updated pull request:

The following changes since commit b3b4e8a7a229cccca915421329a5319f996b0842:
NeilBrown (1):
Avoid skipping devices where removing all faulty/detached devices.

are available in the git repository at:

git://github.com/djbw/mdadm.git master

Dan Williams (10):
mdmon: periodically checkpoint recovery
Kill subarray v2
imsm: dump each disk's view of the slot state
mdmon: record sync_completed directly to the metadata Remove 'checkpointing' side effect of --wait-clean Always assume SKIP_GONE_DEVS behaviour and kill the flag Rename subarray v2
mdmon: prevent allocations due to late binding Merge branch 'subarray' into for-neil
Merge branch 'fixes' into for-neil

Quoted 2 lines

Dave Jiang (1):
create: Check with OROM limit before setting default chunk size

Thanks. They all look credible.
I have pulled and pushed so you can find them in
git://neil.brown.name/mdadm master

Quoted 8 lines

I'm fairly seriously considering cutting a 3.1.3 shortly (Thursday?) so that I have a clean slate to build the policy frame work and aim it for 3.2.0.

If you have anything that you would like to see included in (or addressed for) 3.1.3, please let me know.

Thanks,
NeilBrown

Hey Neil, I'm just back on the job. I'd appreciate a few days to go through all my bugs and see what items not related to the policy framework might need fixed from my perspective for a 3.1.3 release. Thanks ;-)

Signature · 6 lines
Doug Ledford <[email protected]>
              GPG KeyID: CFBFF194
	      http://people.redhat.com/dledford

Infiniband specific RPMs available at
	      http://people.redhat.com/dledford/Infiniband
#10 lore raw
Quoted 6 lines · On Tue, 06 Jul 2010 17:43:37 -0400 Doug Ledford <[email protected]> wrote:
Quoted 6 lines

I'm fairly seriously considering cutting a 3.1.3 shortly (Thursday?) so that I have a clean slate to build the policy frame work and aim it for 3.2.0.

If you have anything that you would like to see included in (or addressed for) 3.1.3, please let me know.

Quoted 8 lines
Quoted 2 lines

Thanks,
NeilBrown

Hey Neil, I'm just back on the job. I'd appreciate a few days to go through all my bugs and see what items not related to the policy framework might need fixed from my perspective for a 3.1.3 release. Thanks ;-)

Welcome back!
If it isn't Thursday then it probably wont be for a couple of weeks as I am travelling next week (and recovering from jet-lag the week after).

Let's say July 22nd is the release date for 3.1.3.

NeilBrown

#11 lore raw
Quoted 18 lines · Neil Brown
Quoted 6 lines · On Tue, 06 Jul 2010 17:43:37 -0400 Doug Ledford <[email protected]> wrote:
Quoted 6 lines

I'm fairly seriously considering cutting a 3.1.3 shortly (Thursday?) so that I have a clean slate to build the policy frame work and aim it for 3.2.0.

If you have anything that you would like to see included in (or addressed for) 3.1.3, please let me know.

Quoted 8 lines
Quoted 2 lines

Thanks,
NeilBrown

Hey Neil, I'm just back on the job. I'd appreciate a few days to go through all my bugs and see what items not related to the policy framework might need fixed from my perspective for a 3.1.3 release. Thanks ;-)

Quoted 7 lines

Welcome back!
If it isn't Thursday then it probably wont be for a couple of weeks as I am travelling next week (and recovering from jet-lag the week after).

Let's say July 22nd is the release date for 3.1.3.

NeilBrown

Well, I *might* have the pull request to you in time for a Thursday release, so we can say as a conservative date the 22nd, but possibly the 8th if things go well.

Signature · 6 lines
Doug Ledford <[email protected]>
              GPG KeyID: CFBFF194
	      http://people.redhat.com/dledford

Infiniband specific RPMs available at
	      http://people.redhat.com/dledford/Infiniband
#12 lore raw
Quoted 4 lines · On Wed, 07 Jul 2010 10:03:33 -0400 Doug Ledford <[email protected]> wrote:
Quoted 4 lines

Welcome back!
If it isn't Thursday then it probably wont be for a couple of weeks as I am travelling next week (and recovering from jet-lag the week after).

Quoted 8 lines
Quoted 3 lines

Let's say July 22nd is the release date for 3.1.3.

NeilBrown

Well, I *might* have the pull request to you in time for a Thursday release, so we can say as a conservative date the 22nd, but possibly the 8th if things go well.

I've actually quite acclimatised to leaving it until the 22nd, so don't rush.

Of course by that I mean 22nd Australian time, which is before 22nd USA time. Thursday 8th and pretty much finished for me now. :-)

NeilBrown