dm-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Hannes Reinecke <hare@suse.de>
To: Christophe Varoqui <christophe.varoqui@gmail.com>
Cc: Hannes Reinecke <hare@suse.com>, dm-devel@redhat.com
Subject: [PATCH 01/26] Revert patch 'move filter_devnode() under vector lock'
Date: Mon,  4 Jul 2016 09:08:21 +0200	[thread overview]
Message-ID: <1467616126-10036-2-git-send-email-hare@suse.de> (raw)
In-Reply-To: <1467616126-10036-1-git-send-email-hare@suse.de>

Patch was causing a segfault during booting and is being
replaced by the following series.

Signed-off-by: Hannes Reinecke <hare@suse.com>
---
 multipathd/main.c | 45 ++++++++++++++++++---------------------------
 1 file changed, 18 insertions(+), 27 deletions(-)

diff --git a/multipathd/main.c b/multipathd/main.c
index c0ca571..3b79aef 100644
--- a/multipathd/main.c
+++ b/multipathd/main.c
@@ -580,11 +580,6 @@ uev_add_path (struct uevent *uev, struct vectors * vecs)
 	pthread_cleanup_push(cleanup_lock, &vecs->lock);
 	lock(vecs->lock);
 	pthread_testcancel();
-	if (filter_devnode(conf->blist_devnode, conf->elist_devnode,
-			   uev->kernel) > 0) {
-		ret = 0;
-		goto out_unlock;
-	}
 	pp = find_path_by_dev(vecs->pathvec, uev->kernel);
 	if (pp) {
 		int r;
@@ -642,7 +637,6 @@ uev_add_path (struct uevent *uev, struct vectors * vecs)
 		free_path(pp);
 		ret = 1;
 	}
-out_unlock:
 	lock_cleanup_pop(vecs->lock);
 	return ret;
 }
@@ -786,23 +780,22 @@ fail:
 static int
 uev_remove_path (struct uevent *uev, struct vectors * vecs)
 {
-	struct path *pp = NULL;
-	int ret = 0;
+	struct path *pp;
+	int ret;
 
 	condlog(2, "%s: remove path (uevent)", uev->kernel);
 	pthread_cleanup_push(cleanup_lock, &vecs->lock);
 	lock(vecs->lock);
 	pthread_testcancel();
-	if (filter_devnode(conf->blist_devnode, conf->elist_devnode,
-			   uev->kernel) == 0) {
-		pp = find_path_by_dev(vecs->pathvec, uev->kernel);
-		if (pp)
-			ret = ev_remove_path(pp, vecs);
-		else
-			/* Not an error; path might have been purged earlier */
-			condlog(0, "%s: path already removed", uev->kernel);
-	}
+	pp = find_path_by_dev(vecs->pathvec, uev->kernel);
+	if (pp)
+		ret = ev_remove_path(pp, vecs);
 	lock_cleanup_pop(vecs->lock);
+	if (!pp) {
+		/* Not an error; path might have been purged earlier */
+		condlog(0, "%s: path already removed", uev->kernel);
+		return 0;
+	}
 	return ret;
 }
 
@@ -912,7 +905,7 @@ uev_update_path (struct uevent *uev, struct vectors * vecs)
 	ro = uevent_get_disk_ro(uev);
 
 	if (ro >= 0) {
-		struct path * pp = NULL;
+		struct path * pp;
 		struct multipath *mpp = NULL;
 
 		condlog(2, "%s: update path write_protect to '%d' (uevent)",
@@ -925,10 +918,6 @@ uev_update_path (struct uevent *uev, struct vectors * vecs)
 		 * need to be at the same indentation level, hence
 		 * this slightly convoluted codepath.
 		 */
-		if (filter_devnode(conf->blist_devnode, conf->elist_devnode,
-				   uev->kernel) > 0) {
-			goto out_unlock;
-		}
 		pp = find_path_by_dev(vecs->pathvec, uev->kernel);
 		if (pp) {
 			if (pp->initialized == INIT_REQUESTED_UDEV) {
@@ -948,13 +937,11 @@ uev_update_path (struct uevent *uev, struct vectors * vecs)
 					uev->kernel, mpp->alias, retval);
 			}
 		}
-	out_unlock:
 		lock_cleanup_pop(vecs->lock);
 		if (!pp) {
-			if (retval)
-				condlog(0, "%s: spurious uevent, path not found",
-					uev->kernel);
-			return retval;
+			condlog(0, "%s: spurious uevent, path not found",
+				uev->kernel);
+			return 1;
 		}
 		if (retval == 2)
 			return uev_add_path(uev, vecs);
@@ -1072,6 +1059,10 @@ uev_trigger (struct uevent * uev, void * trigger_data)
 	/*
 	 * path add/remove event
 	 */
+	if (filter_devnode(conf->blist_devnode, conf->elist_devnode,
+			   uev->kernel) > 0)
+		goto out;
+
 	if (!strncmp(uev->action, "add", 3)) {
 		r = uev_add_path(uev, vecs);
 		goto out;
-- 
2.6.6

  reply	other threads:[~2016-07-04  7:08 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-04  7:08 [PATCHv2 00/26] Userspace-RCU for config accesses Hannes Reinecke
2016-07-04  7:08 ` Hannes Reinecke [this message]
2016-07-04  7:08 ` [PATCH 02/26] Use 'mptable' as argument for find_mpe() and get_mpe_wwid() Hannes Reinecke
2016-07-04  7:08 ` [PATCH 03/26] config: set 'deferred_remove' defaults at correct call Hannes Reinecke
2016-07-04  7:08 ` [PATCH 04/26] devmapper: explicit config settings Hannes Reinecke
2016-07-04  7:08 ` [PATCH 05/26] dmparser: use 'is_daemon' as argument for disassemble_map() Hannes Reinecke
2016-07-04  7:08 ` [PATCH 06/26] libmultipath: use 'is_daemon' as argument for domap() etc Hannes Reinecke
2016-07-04  7:08 ` [PATCH 07/26] libmultipath: drop 'daemon' configuration setting Hannes Reinecke
2016-07-04  7:08 ` [PATCH 08/26] libmultipath: Do not access 'conf->cmd' in domap() Hannes Reinecke
2016-07-04  7:08 ` [PATCH 09/26] libmultipath: add 'cmd' as argument for get_refwwid() Hannes Reinecke
2016-07-04  7:08 ` [PATCH 10/26] libmultipath: fallback to checking environment variable in get_udev_uid() Hannes Reinecke
2016-07-04  7:08 ` [PATCH 11/26] multipath: make 'cmd' internal to multipath program Hannes Reinecke
2016-07-04  7:08 ` [PATCH 12/26] multipath: make 'dev_type' internal to the " Hannes Reinecke
2016-07-04  7:08 ` [PATCH 13/26] multipath: make 'dev' " Hannes Reinecke
2016-07-04  7:08 ` [PATCH 14/26] libmultipath: separate out 'udev' config entry Hannes Reinecke
2016-07-04  7:08 ` [PATCH 15/26] libmultipath: use 'checkint' as argument for sysfs_set_scsi_tmo() Hannes Reinecke
2016-07-04  7:08 ` [PATCH 16/26] discovery: Pass in 'hwtable' for get_state() and scsi_sysfs_discovery() Hannes Reinecke
2016-07-04  7:08 ` [PATCH 17/26] libmultipath: use 'struct config' as argument for pathinfo() Hannes Reinecke
2016-07-04  7:08 ` [PATCH 18/26] checkers: use 'multipath_dir' as argument Hannes Reinecke
2016-07-04  7:08 ` [PATCH 19/26] prio: " Hannes Reinecke
2016-07-04  7:08 ` [PATCH 20/26] libmultipath: use 'timeout' as argument for getprio() Hannes Reinecke
2016-07-04  7:08 ` [PATCH 21/26] libmultipath: use explicit 'config' argument for configuration file parsing Hannes Reinecke
2016-07-04  7:08 ` [PATCH 22/26] libmultipath: use (get, put)_multipath_config() accessors Hannes Reinecke
2016-07-04  7:08 ` [PATCH 23/26] multipathd: Fixup commandline argument handling Hannes Reinecke
2016-07-04  7:08 ` [PATCH 24/26] multipath: make 'struct config' a local variable Hannes Reinecke
2016-07-04  7:08 ` [PATCH 25/26] multipathd: use userspace RCU to access configuration Hannes Reinecke
2016-07-04  7:08 ` [PATCH 26/26] libmultipath: Allocate keywords directly Hannes Reinecke
2016-07-08  5:53 ` [PATCHv2 00/26] Userspace-RCU for config accesses Christophe Varoqui
  -- strict thread matches above, loose matches on Subject: below --
2016-06-20  8:08 [PATCH " Hannes Reinecke
2016-06-20  8:08 ` [PATCH 01/26] Revert patch 'move filter_devnode() under vector lock' Hannes Reinecke

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=1467616126-10036-2-git-send-email-hare@suse.de \
    --to=hare@suse.de \
    --cc=christophe.varoqui@gmail.com \
    --cc=dm-devel@redhat.com \
    --cc=hare@suse.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;
as well as URLs for NNTP newsgroup(s).