summaryrefslogtreecommitdiffstats
path: root/Incremental.c
diff options
context:
space:
mode:
authorPrzemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com>2010-11-22 10:58:06 +0100
committerNeilBrown <neilb@suse.de>2010-11-22 10:58:06 +0100
commit403410eb97e9ae77f99fd7632f0093660748197f (patch)
treef0f95f8d967de84938fddba45b7a63cb2a76039d /Incremental.c
parentTeach IncrementalRemove about containers. (diff)
downloadmdadm-403410eb97e9ae77f99fd7632f0093660748197f.tar.xz
mdadm-403410eb97e9ae77f99fd7632f0093660748197f.zip
extension of IncrementalRemove to store location (path-id) of removed device
If the disk is taken out from its port this port information is lost. Only udev rule can provide us with this information, and then we have to store it somehow. This patch adds writing 'cookie' file in /dev/.mdadm/failed-slots directory in form of file named with value of f<path-id> containing the metadata type and uuid of the array (or container) that the device was a member of. The uuid is in exactly the same format as in the mapfile. FAILED_SLOTS_DIR constant has been added to hold the location of cookie files. Signed-off-by: Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to '')
-rw-r--r--Incremental.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/Incremental.c b/Incremental.c
index 0fef20f5..7b43963c 100644
--- a/Incremental.c
+++ b/Incremental.c
@@ -1385,6 +1385,15 @@ int IncrementalRemove(char *devname, char *id_path, int verbose)
free_mdstat(ent);
return 1;
}
+
+ if (id_path) {
+ struct map_ent *map = NULL, *me;
+ me = map_by_devnum(&map, ent->devnum);
+ if (me)
+ policy_save_path(id_path, me);
+ map_free(map);
+ }
+
memset(&devlist, 0, sizeof(devlist));
devlist.devname = devname;
devlist.disposition = 'f';