diff --git a/WHATS_NEW b/WHATS_NEW index c1f4586ce..ee0393ac9 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.00.32 - ==================================== + Ignore sysfs symlinks when DT_UNKNOWN. Add clvmd init script for RHEL4. Skip devices that are too small to be PVs. Fix pvchange -x segfault with lvm2-format orphan. diff --git a/lib/filters/filter-sysfs.c b/lib/filters/filter-sysfs.c index 8ac08d37e..572493715 100644 --- a/lib/filters/filter-sysfs.c +++ b/lib/filters/filter-sysfs.c @@ -194,8 +194,10 @@ static int _read_devs(struct dev_set *ds, const char *dir) dtype = d->d_type; if (dtype == DT_UNKNOWN) { - if (stat(path, &info) >= 0) { - if (S_ISDIR(info.st_mode)) + if (lstat(path, &info) >= 0) { + if (S_ISLNK(info.st_mode)) + dtype = DT_LNK; + else if (S_ISDIR(info.st_mode)) dtype = DT_DIR; else if (S_ISREG(info.st_mode)) dtype = DT_REG;