All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brian Bunker <brian@purestorage.com>
To: Martin Wilck <martin.wilck@suse.com>,
	Benjamin Marzinski <bmarzins@redhat.com>
Cc: Brian Bunker <brian@purestorage.com>,
	dm-devel@lists.linux.dev,
	Christophe Varoqui <christophe.varoqui@opensvc.com>
Subject: Re: [PATCH v3 1/1] multipathd: don't leave maps read-only after write protect is cleared
Date: Mon, 26 Oct 2026 11:04:41 -0700	[thread overview]
Message-ID: <20261026180444.31357-1-brian@purestorage.com> (raw)
In-Reply-To: <c52f077ad82585f1f02d5b9cc9c3f640e9fcc031.camel@suse.com>

On Mon, 2026-10-26 at 10:26 +0100, Martin Wilck wrote:
> On Fri, 2026-10-23 at 19:40 -0400, Benjamin Marzinski wrote:
> >
> > I do still waver a bit on whether or not we could leave
> > force_readonly
> > set on failed reloads. Once a device turns read-only, it should stay
> > that way until we get another uevent, at which point we will call
> > needs_ro_update() again. Perhaps we just need to make sure that we
> > clear
> > force_readonly when needs_ro_update() returns false.
>
> AFAICS, this is exactly what Brian's v4 patch does. No?

Mostly, yes. v4 sets force_readonly back in dm_addmap_reload() when a
reload fails, so the next reload tries read-only again.

needs_ro_update() doesn't clear it on every false return, though. It
clears it in the dmi.read_only == ro case only when both the map and
the uevent are read-write and none of the map's paths is read-only. If
a path is still read-only, the flag stays set, so a map whose read-only
reload failed keeps retrying instead of staying read-write.

About dm_addmap_create(): agreed that the flag isn't needed for
correctness there, since a new map opens all paths fresh and a
read-write create fails with EROFS anyway. It only saves that first
attempt. Create still clears the flag, so that a value set by
ev_add_path() can't carry over to a later reload. I can drop the
read-only shortcut in create if you'd prefer.

Uday Shankar, who did 430f8f89, also suggested dropping force_readonly
altogether, and tracking the ro state per path in sysfs_pathinfo()
sounds like the right direction to me. But it changes behavior: every
reload, not just the one done for a DISK_RO uevent, would follow the
paths' ro state, and so would "multipath -r", since dm_addmap_reload()
is in libmultipath. So I'd rather do it as a separate series on top of
this fix, and keep this one small enough to backport.

Brian

  reply	other threads:[~2026-10-26 18:04 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-21 18:27 [PATCH v2 0/1] multipathd: don't leave maps read-only after write protect is cleared Brian Bunker
2026-10-21 18:27 ` [PATCH v2 1/1] " Brian Bunker
2026-10-21 19:50   ` Benjamin Marzinski
2026-10-21 21:34   ` mwilck
2026-10-21 23:19     ` [PATCH v3 0/1] " Brian Bunker
2026-10-21 23:19       ` [PATCH v3 1/1] " Brian Bunker
2026-10-22 20:17         ` Martin Wilck
2026-10-23  0:24           ` Benjamin Marzinski
2026-10-23 20:50             ` Martin Wilck
2026-10-23 23:40               ` Benjamin Marzinski
2026-10-26  9:26                 ` Martin Wilck
2026-10-26 18:04                   ` Brian Bunker [this message]
2026-10-26 22:23                     ` Martin Wilck
2026-10-27  4:29                       ` Benjamin Marzinski
2026-10-26 22:20                 ` Martin Wilck
2026-10-27  4:52                   ` 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=20261026180444.31357-1-brian@purestorage.com \
    --to=brian@purestorage.com \
    --cc=bmarzins@redhat.com \
    --cc=christophe.varoqui@opensvc.com \
    --cc=dm-devel@lists.linux.dev \
    --cc=martin.wilck@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.