diff mbox

[49/57] multipathd: do not flush maps on startup

Message ID 1461755458-29225-50-git-send-email-hare@suse.de (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Hannes Reinecke April 27, 2016, 11:10 a.m. UTC
When the daemon is started prior to udev the paths are not present
(yet). However, the maps themselves will be read from device-mapper.
This causes existing maps to be dropped in coalesce_maps(), only
to be reinstated later when all paths are discovered.
To avoid this we should be checking for a valid hardware entry
per multipath map; if there is none we're in startup and shouldn't
drop any maps.

Signed-off-by: Hannes Reinecke <hare@suse.com>
---
 multipathd/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Benjamin Marzinski May 3, 2016, 2:30 a.m. UTC | #1
On Wed, Apr 27, 2016 at 01:10:50PM +0200, Hannes Reinecke wrote:
> When the daemon is started prior to udev the paths are not present
> (yet). However, the maps themselves will be read from device-mapper.
> This causes existing maps to be dropped in coalesce_maps(), only
> to be reinstated later when all paths are discovered.
> To avoid this we should be checking for a valid hardware entry
> per multipath map; if there is none we're in startup and shouldn't
> drop any maps.

This doesn't just skip maps when udev hasn't started yet.  It skips any
blacklisted maps.  For instance, if you create some multipath devices,
add the lines

blacklist {
	devnode ".*"
}

to /etc/multipath.conf, and restart or reload multipathd, all the
blacklisted devices are still there.

NAK

-Ben
> 
> Signed-off-by: Hannes Reinecke <hare@suse.com>
> ---
>  multipathd/main.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/multipathd/main.c b/multipathd/main.c
> index 1141fb6..33a3503 100644
> --- a/multipathd/main.c
> +++ b/multipathd/main.c
> @@ -155,7 +155,7 @@ coalesce_maps(struct vectors *vecs, vector nmpv)
>  
>  	vector_foreach_slot (ompv, ompp, i) {
>  		condlog(3, "%s: coalesce map", ompp->alias);
> -		if (!find_mp_by_wwid(nmpv, ompp->wwid)) {
> +		if (ompp->hwe && !find_mp_by_wwid(nmpv, ompp->wwid)) {
>  			/*
>  			 * remove all current maps not allowed by the
>  			 * current configuration
> -- 
> 2.6.6

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
Hannes Reinecke May 3, 2016, 6:35 a.m. UTC | #2
On 05/03/2016 04:30 AM, Benjamin Marzinski wrote:
> On Wed, Apr 27, 2016 at 01:10:50PM +0200, Hannes Reinecke wrote:
>> When the daemon is started prior to udev the paths are not present
>> (yet). However, the maps themselves will be read from device-mapper.
>> This causes existing maps to be dropped in coalesce_maps(), only
>> to be reinstated later when all paths are discovered.
>> To avoid this we should be checking for a valid hardware entry
>> per multipath map; if there is none we're in startup and shouldn't
>> drop any maps.
> 
> This doesn't just skip maps when udev hasn't started yet.  It skips any
> blacklisted maps.  For instance, if you create some multipath devices,
> add the lines
> 
> blacklist {
> 	devnode ".*"
> }
> 
> to /etc/multipath.conf, and restart or reload multipathd, all the
> blacklisted devices are still there.
> 
> NAK
> 
Okay, I'll remove this patch when I'm resending the patchset.

Cheers,

Hannes
diff mbox

Patch

diff --git a/multipathd/main.c b/multipathd/main.c
index 1141fb6..33a3503 100644
--- a/multipathd/main.c
+++ b/multipathd/main.c
@@ -155,7 +155,7 @@  coalesce_maps(struct vectors *vecs, vector nmpv)
 
 	vector_foreach_slot (ompv, ompp, i) {
 		condlog(3, "%s: coalesce map", ompp->alias);
-		if (!find_mp_by_wwid(nmpv, ompp->wwid)) {
+		if (ompp->hwe && !find_mp_by_wwid(nmpv, ompp->wwid)) {
 			/*
 			 * remove all current maps not allowed by the
 			 * current configuration