diff options
author | Dan Williams <dan.j.williams@intel.com> | 2008-11-10 17:30:07 +0100 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2008-11-28 01:30:02 +0100 |
commit | 900968e382cdd2f1d3960b7d35064d46d1348517 (patch) | |
tree | 7b9398e14cb60aded43a0e75b9991e8473472ee0 | |
parent | Assemble: allow --force to work even when event counts are 0. (diff) | |
download | mdadm-900968e382cdd2f1d3960b7d35064d46d1348517.tar.xz mdadm-900968e382cdd2f1d3960b7d35064d46d1348517.zip |
fix add_dev() handling of broken links
Resolves issues like:
mdadm -Ss
mdadm: unable to open /dev/md/r1: No such file or directory
...where /dev/md/r1 points to a removed device.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
-rw-r--r-- | util.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -433,8 +433,10 @@ int devlist_ready = 0; int add_dev(const char *name, const struct stat *stb, int flag, struct FTW *s) { struct stat st; + if (S_ISLNK(stb->st_mode)) { - stat(name, &st); + if (stat(name, &st) != 0) + return 0; stb = &st; } |