2020-10-14 21:36:17 +00:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Benjamin Marzinski <bmarzins@redhat.com>
|
2021-01-21 16:56:27 +00:00
|
|
|
Date: Wed, 21 Oct 2020 16:39:26 -0500
|
2020-10-14 21:36:17 +00:00
|
|
|
Subject: [PATCH] libmultipath: change log level for null uid_attribute
|
|
|
|
|
|
|
|
If uid_attribute is explicitly set to an empty string, multipath should
|
|
|
|
log the uid at the default log level, since using the fallback code is
|
|
|
|
the expected behavior.
|
|
|
|
|
|
|
|
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
|
2021-01-21 16:56:27 +00:00
|
|
|
Reviewed-by: Martin Wilck <mwilck@suse.com>
|
2020-10-14 21:36:17 +00:00
|
|
|
---
|
2021-01-21 16:56:27 +00:00
|
|
|
libmultipath/discovery.c | 8 ++++++--
|
|
|
|
1 file changed, 6 insertions(+), 2 deletions(-)
|
2020-10-14 21:36:17 +00:00
|
|
|
|
|
|
|
diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c
|
2021-01-21 16:56:27 +00:00
|
|
|
index 877e8f2b..c74f13bf 100644
|
2020-10-14 21:36:17 +00:00
|
|
|
--- a/libmultipath/discovery.c
|
|
|
|
+++ b/libmultipath/discovery.c
|
2021-01-21 16:56:27 +00:00
|
|
|
@@ -2086,8 +2086,11 @@ get_uid (struct path * pp, int path_state, struct udev_device *udev,
|
|
|
|
len = strlen(pp->wwid);
|
|
|
|
origin = "callout";
|
|
|
|
} else {
|
|
|
|
- bool udev_available = udev && pp->uid_attribute
|
|
|
|
+ bool valid_uid_attr = pp->uid_attribute
|
|
|
|
&& *pp->uid_attribute;
|
|
|
|
+ bool empty_uid_attr = pp->uid_attribute
|
|
|
|
+ && !*pp->uid_attribute;
|
|
|
|
+ bool udev_available = udev && valid_uid_attr;
|
|
|
|
|
|
|
|
if (udev_available) {
|
|
|
|
len = get_udev_uid(pp, pp->uid_attribute, udev);
|
|
|
|
@@ -2097,7 +2100,8 @@ get_uid (struct path * pp, int path_state, struct udev_device *udev,
|
2020-10-14 21:36:17 +00:00
|
|
|
}
|
|
|
|
if ((!udev_available || (len <= 0 && allow_fallback))
|
|
|
|
&& has_uid_fallback(pp)) {
|
|
|
|
- used_fallback = 1;
|
2021-01-21 16:56:27 +00:00
|
|
|
+ if (!udev || !empty_uid_attr)
|
2020-10-14 21:36:17 +00:00
|
|
|
+ used_fallback = 1;
|
|
|
|
len = uid_fallback(pp, path_state, &origin);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
--
|
|
|
|
2.17.2
|
|
|
|
|