From: Martin Wilck <mwilck@suse.com>
To: Christophe Varoqui <christophe.varoqui@opensvc.com>,
Chongyun Wu <wu.chongyun@h3c.com>
Cc: dm-devel@redhat.com, Martin Wilck <mwilck@suse.com>
Subject: [PATCH 2/4] libmultipath: get_uid: don't quit prematurely without udev
Date: Tue, 6 Mar 2018 23:15:48 +0100 [thread overview]
Message-ID: <20180306221550.10030-3-mwilck@suse.com> (raw)
In-Reply-To: <20180306221550.10030-1-mwilck@suse.com>
Not all the implemented methods to derive the UID rely on udev
information being present. For example getuid callout, rbd,
and the SCSI vpd code work fine without it. It's unlikely that
we don't get udev data, but we want to be as good as possible
at deriving the uid.
Signed-off-by: Martin Wilck <mwilck@suse.com>
---
libmultipath/discovery.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c
index 53182a85fa10..9f2a9c907914 100644
--- a/libmultipath/discovery.c
+++ b/libmultipath/discovery.c
@@ -1853,11 +1853,6 @@ get_uid (struct path * pp, int path_state, struct udev_device *udev)
put_multipath_config(conf);
}
- if (!udev) {
- condlog(1, "%s: no udev information", pp->dev);
- return 1;
- }
-
memset(pp->wwid, 0, WWID_SIZE);
if (pp->getuid) {
char buff[CALLOUT_MAX_SIZE];
@@ -1881,7 +1876,7 @@ get_uid (struct path * pp, int path_state, struct udev_device *udev)
origin = "sysfs";
} else {
- if (pp->uid_attribute) {
+ if (udev && pp->uid_attribute) {
len = get_udev_uid(pp, pp->uid_attribute, udev);
origin = "udev";
if (len <= 0)
@@ -1900,6 +1895,7 @@ get_uid (struct path * pp, int path_state, struct udev_device *udev)
condlog(1, "%s: failed to get %s uid: %s",
pp->dev, origin, strerror(-len));
memset(pp->wwid, 0x0, WWID_SIZE);
+ return 1;
} else {
/* Strip any trailing blanks */
c = strchr(pp->wwid, '\0');
--
2.16.1
next prev parent reply other threads:[~2018-03-06 22:15 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-06 22:15 [PATCH 0/4] fixes for path wwid detection and path change uevents Martin Wilck
2018-03-06 22:15 ` [PATCH 1/4] libmultipath: get_uid: check VPD pages for SCSI only Martin Wilck
2018-03-06 22:15 ` Martin Wilck [this message]
2018-03-06 22:15 ` [PATCH 3/4] libmultipath: uev_update_path: always warn if WWID changed Martin Wilck
2018-03-06 22:15 ` [PATCH 4/4] libmultipath: uev_update_path: update path properties Martin Wilck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180306221550.10030-3-mwilck@suse.com \
--to=mwilck@suse.com \
--cc=christophe.varoqui@opensvc.com \
--cc=dm-devel@redhat.com \
--cc=wu.chongyun@h3c.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox