All of lore.kernel.org
 help / color / mirror / Atom feed
From: Martin Wilck <mwilck@suse.com>
To: Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: dm-devel@redhat.com, Martin Wilck <mwilck@suse.com>
Subject: [PATCH 2/8] libmultipath: scsi_ioctl_pathinfo doesn't fail
Date: Wed, 10 Oct 2018 22:05:00 +0200	[thread overview]
Message-ID: <20181010200506.15796-3-mwilck@suse.com> (raw)
In-Reply-To: <20181010200506.15796-1-mwilck@suse.com>

This function never returns error, so make a void.
Move the mask test to pathinfo() where it belongs.
The error message about the serial number isn't important
any more, reduce its level to v3.

Signed-off-by: Martin Wilck <mwilck@suse.com>
---
 libmultipath/discovery.c | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c
index b267f07c..8381d982 100644
--- a/libmultipath/discovery.c
+++ b/libmultipath/discovery.c
@@ -1496,7 +1496,7 @@ sysfs_pathinfo(struct path * pp, vector hwtable)
 	}
 }
 
-static int
+static void
 scsi_ioctl_pathinfo (struct path * pp, struct config *conf, int mask)
 {
 	struct udev_device *parent;
@@ -1506,7 +1506,7 @@ scsi_ioctl_pathinfo (struct path * pp, struct config *conf, int mask)
 		detect_alua(pp, conf);
 
 	if (!(mask & DI_SERIAL))
-		return 0;
+		return;
 
 	parent = pp->udev;
 	while (parent) {
@@ -1525,17 +1525,17 @@ scsi_ioctl_pathinfo (struct path * pp, struct config *conf, int mask)
 		parent = udev_device_get_parent(parent);
 	}
 	if (!attr_path || pp->sg_id.host_no == -1)
-		return 0;
+		return;
 
 	if (get_vpd_sysfs(parent, 0x80, pp->serial, SERIAL_SIZE) <= 0) {
 		if (get_serial(pp->serial, SERIAL_SIZE, pp->fd)) {
-			condlog(2, "%s: fail to get serial", pp->dev);
-			return 0;
+			condlog(3, "%s: fail to get serial", pp->dev);
+			return;
 		}
 	}
 
 	condlog(3, "%s: serial = %s", pp->dev, pp->serial);
-	return 0;
+	return;
 }
 
 static int
@@ -1937,9 +1937,8 @@ int pathinfo(struct path *pp, struct config *conf, int mask)
 	if (mask & DI_SERIAL)
 		get_geometry(pp);
 
-	if (path_state == PATH_UP && pp->bus == SYSFS_BUS_SCSI &&
-	    scsi_ioctl_pathinfo(pp, conf, mask))
-		goto blank;
+	if (path_state == PATH_UP && pp->bus == SYSFS_BUS_SCSI)
+		scsi_ioctl_pathinfo(pp, conf, mask);
 
 	if (pp->bus == SYSFS_BUS_CCISS &&
 	    cciss_ioctl_pathinfo(pp, mask))
-- 
2.19.0

  parent reply	other threads:[~2018-10-10 20:05 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-10 20:04 [PATCH 0/8] various multipath-tools patches Martin Wilck
2018-10-10 20:04 ` [PATCH 1/8] test-kpartx: add test for invocation on image file Martin Wilck
2018-10-12 21:45   ` Benjamin Marzinski
2018-10-10 20:05 ` Martin Wilck [this message]
2018-10-12 21:46   ` [PATCH 2/8] libmultipath: scsi_ioctl_pathinfo doesn't fail Benjamin Marzinski
2018-10-10 20:05 ` [PATCH 3/8] libmultipath: cciss_ioctl_pathinfo " Martin Wilck
2018-10-12 21:47   ` Benjamin Marzinski
2018-10-10 20:05 ` [PATCH 4/8] multipath.rules: add comment about DM_MULTIPATH_DEVICE_PATH=2 Martin Wilck
2018-10-12 21:49   ` Benjamin Marzinski
2018-10-10 20:05 ` [PATCH 5/8] multipath.8: man page update Martin Wilck
2018-10-12 21:51   ` Benjamin Marzinski
2018-10-10 20:05 ` [PATCH 6/8] libmultipath: test code for "zombie" TUR threads Martin Wilck
2018-10-12 21:51   ` Benjamin Marzinski
2018-10-10 20:05 ` [PATCH 7/8] libmultipath: handle TUR threads that can't be cancelled Martin Wilck
2018-10-12 22:11   ` Benjamin Marzinski
2018-10-23 10:58     ` Martin Wilck
2018-10-10 20:05 ` [PATCH 8/8] multipathd: handle repeated udev retrigger failure Martin Wilck
2018-10-12 22:30   ` Benjamin Marzinski
2018-10-13  8:48 ` [PATCH 0/8] various multipath-tools patches Christophe Varoqui

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=20181010200506.15796-3-mwilck@suse.com \
    --to=mwilck@suse.com \
    --cc=christophe.varoqui@opensvc.com \
    --cc=dm-devel@redhat.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 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.