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, Christophe Varoqui <christophe.varoqui@gmail.com>
Subject: Re: [PATCH 4/6] libmultipath: Fixup 'DM_DEVICE_RELOAD' handling
Date: Mon, 9 May 2016 12:26:36 +0200	[thread overview]
Message-ID: <573065DC.8060909@suse.de> (raw)
In-Reply-To: <20160506201240.GU26117@octiron.msp.redhat.com>

On 05/06/2016 10:12 PM, Benjamin Marzinski wrote:
> On Wed, May 04, 2016 at 07:57:28AM +0200, Hannes Reinecke wrote:
>> libdevmapper has the 'quirk' that DM_DEVICE_CREATE is translated
>> internally into a create/load/resume sequence, and the associated
>> cookie will wait for the last 'resume' to complete.
>> However, DM_DEVICE_RELOAD has no such translation, so if there
>> is a cookie assigned to it the caller _cannot_ wait for it,
>> as the cookie will only ever be completed upon the next
>> DM_DEVICE_RESUME.
>> multipathd already has some provisions for that (but even there
>> the cookie handling is dodgy), but 'multipath -r' doesn't know
>> about this.
>> So to avoid any future irritations this patch updates the
>> dm_addmad_reload() call to handle the cookie correctly,
>> and removes the special handling from multipathd.
> 
> I don't see what's multipathd specific about any of the handling here.
> The real answer is that device-mapper does nothing with cookies on
> table reload. We should never be calling dm_task_set_cookie() for 
> dm_addmap(DM_DEVICE_RELOAD, ...) calls in the first place. We end up
> creating a cookie, decrementing the cookie, incrementing the cookie, and
> finally waiting on it, when we could just be creating a cookie and then
> waiting on it.
> 
> It's kind of hard to find an easy to show example of this breaking. You
> would need to have the dm_addmap() command fail with some other error than
> EROFS.  If that happens, the dm_simplecmd() call will never happen, and
> there will be a cookie sitting around on the system.  If we never added
> a cookie to the task in dm_addmap(DM_DEVICE_RELOAD, ...), then there
> wouldn't be this cookie sitting around.
> 
But then ... how is this supposed to work?
Are we supposed to call DM_DEVICE_RESUME even after DM_DEVICE_RELOAD
failed?
None of the other callers do that ...

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-05-09 10:26 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-04  5:57 [PATCH 0/6] multipath cookie handling rework Hannes Reinecke
2016-05-04  5:57 ` [PATCH 1/6] libmultipath: pass in cookie as argument for dm_simplecmd() Hannes Reinecke
2016-05-06 19:06   ` Benjamin Marzinski
2016-05-04  5:57 ` [PATCH 2/6] libmultipath: pass in 'cookie' as argument for dm_addmap() Hannes Reinecke
2016-05-06 19:27   ` Benjamin Marzinski
2016-05-04  5:57 ` [PATCH 3/6] Remove 'udev_sync' argument from dm_simplecmd() Hannes Reinecke
2016-05-06 19:50   ` Benjamin Marzinski
2016-05-04  5:57 ` [PATCH 4/6] libmultipath: Fixup 'DM_DEVICE_RELOAD' handling Hannes Reinecke
2016-05-06 20:12   ` Benjamin Marzinski
2016-05-09 10:26     ` Hannes Reinecke [this message]
2016-05-09 14:56       ` Benjamin Marzinski
2016-05-04  5:57 ` [PATCH 5/6] devmapper: do not flush I/O for DM_DEVICE_CREATE Hannes Reinecke
2016-05-06 20:18   ` Benjamin Marzinski
2016-05-04  5:57 ` [PATCH 6/6] libmultipath: fixup dm_rename to complete cookie on failure Hannes Reinecke
2016-05-06 20:29   ` Benjamin Marzinski
2016-05-06 21:59     ` Alasdair G Kergon
2016-05-06 22:45       ` Benjamin Marzinski

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=573065DC.8060909@suse.de \
    --to=hare@suse.de \
    --cc=bmarzins@redhat.com \
    --cc=christophe.varoqui@gmail.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.