1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

dev-cache: enhance dir scan also for non-udev build

This commit is contained in:
Zdenek Kabelac 2021-10-18 21:50:56 +02:00
parent 88e0d68909
commit 60dc44b707

View File

@ -1099,10 +1099,18 @@ static int _device_in_udev_db(const dev_t d)
static void _insert_dirs(struct dm_list *dirs)
{
struct dir_list *dl;
struct stat tinfo;
dm_list_iterate_items(dl, &_cache.dirs)
dm_list_iterate_items(dl, &_cache.dirs) {
if (stat(dl->dir, &tinfo) < 0) {
log_warn("WARNING: Cannot use dir %s, %s.",
dl->dir, strerror(errno));
continue;
}
_cache.st_dev = tinfo.st_dev;
_insert_dir(dl->dir);
}
}
#endif /* UDEV_SYNC_SUPPORT */