* main - dev-cache: enhance dir scan also for non-udev build
@ 2021-10-18 19:51 Zdenek Kabelac
0 siblings, 0 replies; only message in thread
From: Zdenek Kabelac @ 2021-10-18 19:51 UTC (permalink / raw)
To: lvm-devel
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=60dc44b707149e31fa766885574484aa5172f498
Commit: 60dc44b707149e31fa766885574484aa5172f498
Parent: 88e0d68909c007576272d65216b0e7a9011b9c9b
Author: Zdenek Kabelac <zkabelac@redhat.com>
AuthorDate: Mon Oct 18 21:50:56 2021 +0200
Committer: Zdenek Kabelac <zkabelac@redhat.com>
CommitterDate: Mon Oct 18 21:50:56 2021 +0200
dev-cache: enhance dir scan also for non-udev build
---
lib/device/dev-cache.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/lib/device/dev-cache.c b/lib/device/dev-cache.c
index 57fa916a9..c6e5f68cf 100644
--- a/lib/device/dev-cache.c
+++ b/lib/device/dev-cache.c
@@ -1099,9 +1099,17 @@ 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 */
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2021-10-18 19:51 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-18 19:51 main - dev-cache: enhance dir scan also for non-udev build Zdenek Kabelac
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.