All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hannes Reinecke <hare@suse.de>
To: Benjamin Marzinski <bmarzins@redhat.com>
Cc: dm-devel@redhat.com, Hannes Reinecke <hare@suse.com>,
	Christophe Varoqui <christophe.varoqui@gmail.com>
Subject: Re: [PATCH 17/26] libmultipath: use 'struct config' as argument for pathinfo()
Date: Mon, 4 Jul 2016 07:49:03 +0200	[thread overview]
Message-ID: <5779F8CF.9060402@suse.de> (raw)
In-Reply-To: <20160701202537.GY8095@octiron.msp.redhat.com>

On 07/01/2016 10:25 PM, Benjamin Marzinski wrote:
> On Mon, Jun 20, 2016 at 10:09:04AM +0200, Hannes Reinecke wrote:
>> pathinfo() requires access to the entire configuration, not just
>> hwtable. So don't pretend this is the case.
>>
>> Signed-off-by: Hannes Reinecke <hare@suse.com>
>> ---
>>  libmpathpersist/mpath_persist.c |  6 +++---
>>  libmultipath/configure.c        |  8 ++++----
>>  libmultipath/discovery.c        | 37 ++++++++++++++++++-------------------
>>  libmultipath/discovery.h        |  8 ++++----
>>  libmultipath/structs_vec.c      |  2 +-
>>  multipath/main.c                |  6 +++---
>>  multipathd/cli_handlers.c       |  2 +-
>>  multipathd/main.c               | 16 ++++++++--------
>>  8 files changed, 42 insertions(+), 43 deletions(-)
>>
> 
> <snip>
> 
>> --- a/libmultipath/discovery.c
>> +++ b/libmultipath/discovery.c
>> @@ -32,7 +32,7 @@
>>  #include "defaults.h"
>>  
>>  int
>> -alloc_path_with_pathinfo (vector hwtable, struct udev_device *udevice,
>> +alloc_path_with_pathinfo (struct config *conf, struct udev_device *udevice,
>>  			  int flag, struct path **pp_ptr)
>>  {
>>  	int err = PATHINFO_FAILED;
>> @@ -55,7 +55,7 @@ alloc_path_with_pathinfo (vector hwtable, struct udev_device *udevice,
>>  		condlog(0, "pp->dev too small");
>>  	} else {
>>  		pp->udev = udev_device_ref(udevice);
>> -		err = pathinfo(pp, hwtable, flag | DI_BLACKLIST);
>> +		err = pathinfo(pp, conf, flag | DI_BLACKLIST);
>>  	}
>>  
>>  	if (err)
>> @@ -66,8 +66,8 @@ alloc_path_with_pathinfo (vector hwtable, struct udev_device *udevice,
>>  }
>>  
>>  int
>> -store_pathinfo (vector pathvec, vector hwtable, struct udev_device *udevice,
>> -		int flag, struct path **pp_ptr)
>> +store_pathinfo (vector pathvec, struct config *conf,
>> +		struct udev_device *udevice, int flag, struct path **pp_ptr)
>>  {
>>  	int err = PATHINFO_FAILED;
>>  	struct path * pp;
>> @@ -90,7 +90,7 @@ store_pathinfo (vector pathvec, vector hwtable, struct udev_device *udevice,
>>  		goto out;
>>  	}
>>  	pp->udev = udev_device_ref(udevice);
>> -	err = pathinfo(pp, hwtable, flag);
>> +	err = pathinfo(pp, conf, flag);
>>  	if (err)
>>  		goto out;
>>  
>> @@ -126,10 +126,10 @@ path_discover (vector pathvec, struct config * conf,
>>  
>>  	pp = find_path_by_dev(pathvec, (char *)devname);
>>  	if (!pp) {
>> -		return store_pathinfo(pathvec, conf->hwtable,
>> +		return store_pathinfo(pathvec, conf,
>>  				      udevice, flag, NULL);
>>  	}
>> -	return pathinfo(pp, conf->hwtable, flag);
>> +	return pathinfo(pp, conf, flag);
>>  }
>>  
>>  int
>> @@ -1397,7 +1397,7 @@ cciss_ioctl_pathinfo (struct path * pp, int mask)
>>  }
>>  
>>  int
>> -get_state (struct path * pp, vector hwtable, int daemon)
>> +get_state (struct path * pp, struct config *conf)
>>  {
>>  	struct checker * c = &pp->checker;
>>  	int state;
>> @@ -1405,8 +1405,8 @@ get_state (struct path * pp, vector hwtable, int daemon)
>>  	condlog(3, "%s: get_state", pp->dev);
>>  
>>  	if (!checker_selected(c)) {
>> -		if (daemon) {
>> -			if (pathinfo(pp, hwtable, DI_SYSFS) != PATHINFO_OK) {
>> +		if (!pp->hwe) {
>> +			if (pathinfo(pp, conf, DI_SYSFS) != PATHINFO_OK) {
>>  				condlog(3, "%s: couldn't get sysfs pathinfo",
>>  					pp->dev);
>>  				return PATH_UNCHECKED;
>> @@ -1425,12 +1425,11 @@ get_state (struct path * pp, vector hwtable, int daemon)
>>  		}
>>  	}
>>  	checker_clear_message(c);
>> -	if (daemon) {
>> -		if (conf->force_sync == 0)
>> -			checker_set_async(c);
>> -		else
>> -			checker_set_sync(c);
>> -	}
>> +	if (conf->force_sync == 0)
>> +		checker_set_async(c);
>> +	else
>> +		checker_set_sync(c);
>> +
>>  	if (!conf->checker_timeout &&
>>  	    sysfs_get_timeout(pp, &(c->timeout)) <= 0)
>>  		c->timeout = DEF_TIMEOUT;
> 
> I don't think that this change to get_state is correct. Previously,
> we've always had the checker set to synchronous mode when run by the
> multipath command.  With this change the checker will now run in async
> mode by default.  It should be easy to just overwrite conf->force_sync
> when running the multipath command to fix this.
> 
Yes, indeed. You are correct.

I will fix this up.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		   Teamlead Storage & Networking
hare@suse.de			               +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)

  reply	other threads:[~2016-07-04  5:49 UTC|newest]

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