Linux Device Mapper development
 help / color / mirror / Atom feed
From: "Benjamin Marzinski" <bmarzins@redhat.com>
To: Martin Wilck <mwilck@suse.com>
Cc: mwilck+gmail@suse.de, dm-devel@redhat.com
Subject: Re: [PATCH v2 23/24] domap(): never return DOMAP_RETRY in daemon mode
Date: Tue, 11 Dec 2018 11:41:45 -0600	[thread overview]
Message-ID: <20181211174145.GG13270@octiron.msp.redhat.com> (raw)
In-Reply-To: <f38d7a41bb82324eb0d6d362bf68ba637012899e.camel@suse.com>

On Sun, Dec 09, 2018 at 10:06:05PM +0100, Martin Wilck wrote:
> On Mon, 2018-12-03 at 17:45 -0600,  Benjamin Marzinski  wrote:
> 
> TL;DR: I'm 99.7% sure we don't need lock_multipath() any more.
> 
> The historic reason is 4d7a270:
> 
>     'Multiple multipath(8) execs can race with udev storm.
>     
>     We can simulate this with the following :
>     "multipath -F; /sbin/multipath 8:16 & /sbin/multipath 8:32"
>     
>     Problem arise when two runs are about to create the same map.
>     One will fail, leaving us with a choice : abord or retry.'
> 
> This commit was made at a time (October 2005) when multipath was called
> directly from udev rules to set up maps. Earlier versions of multipath
> had a general locking that would not allow multiple multipath commands
> to run in parallel, but that has been removed later. This was an
> attempt to lock only (would-be) members of one specific map.
> 
> Obviously, the goal of this patch wouldn't be achieved any more since
> the lock has been change to non-exclusive (1c50cd32). Multiple
> multipath instances run happily on members of the same set now. I
> haven't tested it, but I believe the historic race "/sbin/multipath
> 8:16 & /sbin/multipath 8:32" still exists; just we don't run multipath
> this way from udev rules any more. 
> 
> lock_multipath() doesn't help us void this race, as we can't go back to
> exclusive locking. If we want to avoid it, we could create a lock file
> from the WWID before calling domap(), /dev/shm/multipath/$WWID.lock or
> so. Or we could use a SYSV semaphore set.

I vote for removing lock_multipath(). Personally, I've never seen anyone
report the anything that looks like a multiple creation race since we've
changed the locking to shared, so I'm fine with leaving it out, but I
certainly wouldn't NAK a patch that added useful locking back in.

-Ben

  reply	other threads:[~2018-12-11 17:41 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-03 19:36 [PATCH v2 00/24] multipath-tools: improve logging at -v3 Martin Wilck
2018-12-03 19:36 ` [PATCH v2 16/24] libmultipath: coalesce_paths: fix size mismatch handling Martin Wilck
2018-12-03 19:36 ` [PATCH v2 20/24] libmultipath: avoid syslog loglevel > LOG_DEBUG Martin Wilck
2018-12-03 19:36 ` [PATCH v2 21/24] coalesce_paths(): use symbolic return value Martin Wilck
2018-12-03 19:36 ` [PATCH v2 22/24] domap(): " Martin Wilck
2018-12-03 19:36 ` [PATCH v2 23/24] domap(): never return DOMAP_RETRY in daemon mode Martin Wilck
2018-12-03 23:45   ` Benjamin Marzinski
2018-12-09 21:06     ` Martin Wilck
2018-12-11 17:41       ` Benjamin Marzinski [this message]
2018-12-03 19:36 ` [PATCH v2 24/24] multipath: use symbolic return value and exit code Martin Wilck
2018-12-03 23:48   ` Benjamin Marzinski
2018-12-03 23:50 ` [PATCH v2 00/24] multipath-tools: improve logging at -v3 Benjamin Marzinski
2018-12-07 16:02   ` 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=20181211174145.GG13270@octiron.msp.redhat.com \
    --to=bmarzins@redhat.com \
    --cc=dm-devel@redhat.com \
    --cc=mwilck+gmail@suse.de \
    --cc=mwilck@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