summaryrefslogtreecommitdiffstats
path: root/super-ddf.c
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2009-02-24 18:45:56 -0700
committerDan Williams <dan.j.williams@intel.com>2009-02-24 18:45:56 -0700
commitdab4a5134e8d946f3809163af6abb80a945c904c (patch)
tree74c51faa30b739d3449d00b691295332efffa747 /super-ddf.c
parentdb575f3b9ebfdf0d7ac8dd5f9b1d4b4d0e446e80 (diff)
downloadmdadm-dab4a5134e8d946f3809163af6abb80a945c904c.tar.gz
mdadm-dab4a5134e8d946f3809163af6abb80a945c904c.tar.xz
mdadm-dab4a5134e8d946f3809163af6abb80a945c904c.zip
sysfs: allow sysfs_read to detect and drop removed disks
All operations that rely on loading from an existing container (like --add) will fail after a disk has been removed. Provide an option to skip missing / offline disks rather than abort. We attempt to do this in the load_super_{imsm,ddf}_all cases when mdmon is running i.e. we already have a consitent version of the metadata running in the system. Otherwise, we fail as normal and let the administrator fix up the container. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'super-ddf.c')
-rw-r--r--super-ddf.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/super-ddf.c b/super-ddf.c
index f621f4d..6c75998 100644
--- a/super-ddf.c
+++ b/super-ddf.c
@@ -2734,8 +2734,14 @@ static int load_super_ddf_all(struct supertype *st, int fd,
int seq;
char nm[20];
int dfd;
+ int devnum = fd2devnum(fd);
+ enum sysfs_read_flags flags;
- sra = sysfs_read(fd, 0, GET_LEVEL|GET_VERSION|GET_DEVS|GET_STATE);
+ flags = GET_LEVEL|GET_VERSION|GET_DEVS|GET_STATE;
+ if (mdmon_running(devnum))
+ flags |= SKIP_GONE_DEVS;
+
+ sra = sysfs_read(fd, 0, flags);
if (!sra)
return 1;
if (sra->array.major_version != -1 ||