linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Ilya Dryomov <idryomov@gmail.com>
Cc: wgh@torlan.ru, Jens Axboe <axboe@kernel.dk>,
	linux-block <linux-block@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Sagi Grimberg <sagi@grimberg.me>,
	Mike Snitzer <snitzer@redhat.com>,
	dm-devel@redhat.com
Subject: Re: LVM snapshot broke between 4.14 and 4.16
Date: Thu, 2 Aug 2018 11:32:54 -0700	[thread overview]
Message-ID: <CA+55aFy2DR9fxHhmGq+azSjX9D71YtLsuFKmoEuYW3uTAUYtJg@mail.gmail.com> (raw)
In-Reply-To: <CAOi1vP-SJO4AMK=XD3Lmja++2dQqoiw6Zn8Vgxf8OfvYgnuC6Q@mail.gmail.com>

On Thu, Aug 2, 2018 at 11:18 AM Ilya Dryomov <idryomov@gmail.com> wrote:
>
> I think it was my commit 721c7fc701c7 ("block: fail op_is_write()
> requests to read-only partitions").  The block layer was previously
> allowing non-blkdev_write_iter() writes to read-only disks and
> partitions.  dm's chunk_io() boils down to submit_bio(), so in 4.16
> it started to fail if the underlying device was marked read-only.

Ugh. That commit does look like the obviously right thing to do, and
our old behavior was obviously wrong.

At the same time, we really really shouldn't break user flow, even if
that flow was due to an obvious bug.

Dang.

> Apparently at least some versions of lvm(8) instruct dm to mark the COW
> device read-only even though it is always written to.  It comes up only
> if the user asks for a read-only snapshot (the default is writable).
>
> One option might be to ignore the supplied DM_READONLY_FLAG for COW
> devices.  Marking the COW device (i.e. the exception store) read-only
> is probably never sane...

That sounds like possibly the sanest fixlet for this - perhaps
together with a warning message saying "ignoring DM_READONLY_FLAG for
COW device" so that people see that they are doing insane things.

But some of our internal DM_READONLY_FLAG use obviously comes from
other sources that we have to honor (ie some grepping shows me code
like

                if (get_disk_ro(disk))
                        param->flags |= DM_READONLY_FLAG;

where we obviously can *not* override the get_disk_ro() state. So it
depends a lot on how this all happened. But it looks like in this
particular case, it all came from one inconsistent lvmcreate command.

Or - if there really is only _one_ user that noticed this, and a new
lvm2 release fixes his problem, maybe we can say "we broke it, but the
only person who reported it can work around it".

WGH (sorry, no idea what your real name is) - what's the source of the
script that broke? Was it some system script you got from outside and
likely to affect others too?

Or was it just some local thing you wrote yourself and was
unintentionally buggy and nobody else is likely to hit this?

Because if the latter, if you can work around it and you're the only
user this hits, we might just be able to ignore it.

                   Linus

  reply	other threads:[~2018-08-02 18:33 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-02 12:26 LVM snapshot broke between 4.14 and 4.16 WGH
2018-08-02 13:31 ` Ilya Dryomov
2018-08-02 15:10   ` WGH
2018-08-02 16:41     ` Linus Torvalds
2018-08-02 18:18       ` Ilya Dryomov
2018-08-02 18:32         ` Linus Torvalds [this message]
2018-08-02 21:32           ` WGH
2018-08-02 21:39             ` WGH
2018-08-02 21:52               ` Linus Torvalds
2018-08-03 13:31                 ` Mike Snitzer
2018-08-03 15:20                   ` [dm-devel] " Theodore Y. Ts'o
2018-08-03 18:39                     ` Mike Snitzer
2018-08-03 18:57                       ` Linus Torvalds
2018-08-03 19:06                         ` Mike Snitzer
2018-08-03 19:11                           ` Linus Torvalds
2018-08-03 19:33                             ` Mike Snitzer
2018-08-03 19:22                           ` Linus Torvalds
2018-08-04 10:01                             ` WGH
2018-08-04 17:04                               ` Linus Torvalds
2018-08-04 18:19                                 ` Mike Snitzer
2018-08-04 20:29                                 ` WGH
     [not found]                     ` <20180803195636.GA31444@agk-dp.fab.redhat.com>
     [not found]                       ` <20180803200817.GB31444@agk-dp.fab.redhat.com>
2018-08-03 20:42                         ` [dm-devel] " Linus Torvalds
2018-08-03 21:26                           ` Alasdair G Kergon
2018-08-03 13:31                 ` Zdenek Kabelac
2018-08-03 16:37                   ` Linus Torvalds
2018-08-03 18:54                     ` Mike Snitzer
2018-08-03 19:09                       ` Linus Torvalds
2018-08-03 19:30                         ` Mike Snitzer
2018-08-03 19:36                           ` Linus Torvalds
2018-08-04  5:20                           ` [dm-devel] " Theodore Y. Ts'o
2018-08-04  8:36                             ` Zdenek Kabelac
2018-08-04 16:22                               ` Theodore Y. Ts'o
2018-08-04 18:18                                 ` Mike Snitzer
2018-08-04 19:37                                   ` Theodore Y. Ts'o
2018-08-04 21:48                                     ` Mike Snitzer
2018-08-04 15:19                             ` Mike Snitzer
2018-08-03 19:18                     ` [dm-devel] " Zdenek Kabelac
2018-08-03 19:30                       ` Linus Torvalds

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=CA+55aFy2DR9fxHhmGq+azSjX9D71YtLsuFKmoEuYW3uTAUYtJg@mail.gmail.com \
    --to=torvalds@linux-foundation.org \
    --cc=axboe@kernel.dk \
    --cc=dm-devel@redhat.com \
    --cc=idryomov@gmail.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sagi@grimberg.me \
    --cc=snitzer@redhat.com \
    --cc=wgh@torlan.ru \
    /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;
as well as URLs for NNTP newsgroup(s).