diff options
author | Dan Williams <dan.j.williams@intel.com> | 2010-06-16 17:26:04 -0700 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2010-06-16 17:26:04 -0700 |
commit | b526e52dc7cbdde98db9c9f8765be28ba6d71d78 (patch) | |
tree | c9c303fc940a4da78996d26f829271913fe8b730 /super-intel.c | |
parent | fd547b508c90a647cf60df678047f07046cf5c68 (diff) | |
download | mdadm-b526e52dc7cbdde98db9c9f8765be28ba6d71d78.tar.gz |
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.
Reported-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'super-intel.c')
-rw-r--r-- | super-intel.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/super-intel.c b/super-intel.c index d6d8b09..e09ce5e 100644 --- a/super-intel.c +++ b/super-intel.c @@ -2747,14 +2747,9 @@ static int load_super_imsm_all(struct supertype *st, int fd, void **sbp, int retry; int err = 0; int i; - enum sysfs_read_flags flags; - - flags = GET_LEVEL|GET_VERSION|GET_DEVS|GET_STATE; - if (mdmon_running(devnum)) - flags |= SKIP_GONE_DEVS; /* check if 'fd' an opened container */ - sra = sysfs_read(fd, 0, flags); + sra = sysfs_read(fd, 0, GET_LEVEL|GET_VERSION|GET_DEVS|GET_STATE); if (!sra) return 1; |