diff --git a/lib/device/dev-cache.c b/lib/device/dev-cache.c index e038263ac..d61185ff4 100644 --- a/lib/device/dev-cache.c +++ b/lib/device/dev-cache.c @@ -409,13 +409,13 @@ int get_sysfs_value(const char *path, char *buf, size_t buf_size, int error_if_n if (!(fp = fopen(path, "r"))) { if (error_if_no_value) - log_sys_error("fopen", path); + log_sys_debug("fopen", path); return 0; } if (!fgets(buf, buf_size, fp)) { if (error_if_no_value) - log_sys_error("fgets", path); + log_sys_debug("fgets", path); goto out; } diff --git a/lib/device/dev-mpath.c b/lib/device/dev-mpath.c index 8e4393a21..3417f392f 100644 --- a/lib/device/dev-mpath.c +++ b/lib/device/dev-mpath.c @@ -759,12 +759,14 @@ const char *dev_mpath_component_wwid(struct cmd_context *cmd, struct device *dev /* read /sys/block/sda/device/wwid */ if (dm_snprintf(wwid_path, sizeof(wwid_path), "%sblock/%s/device/wwid", - dm_sysfs_dir(), slave_name) < 0) { + dm_sysfs_dir(), slave_name) < 0) { log_warn("Failed to create sysfs wwid path for %s", slave_name); continue; } - get_sysfs_value(wwid_path, sysbuf, sizeof(sysbuf), 0); + if (!get_sysfs_value(wwid_path, sysbuf, sizeof(sysbuf), 0)) + stack; + if (!sysbuf[0]) continue; @@ -784,5 +786,3 @@ const char *dev_mpath_component_wwid(struct cmd_context *cmd, struct device *dev return wwid; } - - diff --git a/lib/device/device_id.c b/lib/device/device_id.c index 425c0d64b..8fa7b519d 100644 --- a/lib/device/device_id.c +++ b/lib/device/device_id.c @@ -215,7 +215,9 @@ static int _searched_devnames_exists(struct cmd_context *cmd, if (pvids_ok && devs_ok) ret = 1; out: - fclose(fp); + if (fclose(fp)) + log_sys_debug("fclose", _searched_file); + log_debug("searched_devnames %s file pvids %d %u devs %d %u search pvids %d %u devs %d %u", ret ? "match" : "differ", pvids_count_file, pvids_hash_file, devs_count_file, devs_hash_file,