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

devcache: track more udev errors

Add a bit more details for failing udev function.
This commit is contained in:
Zdenek Kabelac 2017-10-30 13:16:50 +01:00
parent af21263cb3
commit e9206fb93d

View File

@ -939,12 +939,20 @@ static int _insert_udev_dir(struct udev *udev, const char *dir)
struct udev_device *device; struct udev_device *device;
int r = 1; int r = 1;
if (!(udev_enum = udev_enumerate_new(udev))) if (!(udev_enum = udev_enumerate_new(udev))) {
goto bad; log_error("Failed to udev_enumerate_new.");
return 0;
}
if (udev_enumerate_add_match_subsystem(udev_enum, "block") || if (udev_enumerate_add_match_subsystem(udev_enum, "block")) {
udev_enumerate_scan_devices(udev_enum)) log_error("Failed to udev_enumerate_add_match_subsystem.");
goto bad; goto out;
}
if (udev_enumerate_scan_devices(udev_enum)) {
log_error("Failed to udev_enumerate_scan_devices.");
goto out;
}
/* /*
* Report any missing information as "log_very_verbose" only, do not * Report any missing information as "log_very_verbose" only, do not
@ -981,13 +989,10 @@ static int _insert_udev_dir(struct udev *udev, const char *dir)
udev_device_unref(device); udev_device_unref(device);
} }
out:
udev_enumerate_unref(udev_enum); udev_enumerate_unref(udev_enum);
return r;
bad: return r;
log_error("Failed to enumerate udev device list.");
udev_enumerate_unref(udev_enum);
return 0;
} }
static void _insert_dirs(struct dm_list *dirs) static void _insert_dirs(struct dm_list *dirs)