mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-22 17:35:59 +03:00
Don't recurse symlinked dirs such as /dev/fd on 2.6.
This commit is contained in:
parent
68c07aeeb3
commit
08c419da66
@ -313,6 +313,17 @@ static int _insert(const char *path, int rec)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (S_ISDIR(info.st_mode)) { /* add a directory */
|
if (S_ISDIR(info.st_mode)) { /* add a directory */
|
||||||
|
/* check it's not a symbolic link */
|
||||||
|
if (lstat(path, &info) < 0) {
|
||||||
|
log_sys_very_verbose("lstat", path);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (S_ISLNK(info.st_mode)) {
|
||||||
|
log_debug("%s: Symbolic link to directory", path);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (rec)
|
if (rec)
|
||||||
r = _insert_dir(path);
|
r = _insert_dir(path);
|
||||||
|
|
||||||
@ -471,7 +482,7 @@ const char *dev_name_confirmed(struct device *dev, int quiet)
|
|||||||
}
|
}
|
||||||
if (quiet)
|
if (quiet)
|
||||||
log_debug("Path %s no longer valid for device(%d,%d)",
|
log_debug("Path %s no longer valid for device(%d,%d)",
|
||||||
name, (int) MAJOR(dev->dev),
|
name, (int) MAJOR(dev->dev),
|
||||||
(int) MINOR(dev->dev));
|
(int) MINOR(dev->dev));
|
||||||
else
|
else
|
||||||
log_error("Path %s no longer valid for device(%d,%d)",
|
log_error("Path %s no longer valid for device(%d,%d)",
|
||||||
|
Loading…
Reference in New Issue
Block a user