All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Kani, Toshi" <toshi.kani@hpe.com>
To: "jack@suse.cz" <jack@suse.cz>, "snitzer@redhat.com" <snitzer@redhat.com>
Cc: "linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
	"dm-devel@redhat.com" <dm-devel@redhat.com>,
	"linux-nvdimm@lists.01.org" <linux-nvdimm@lists.01.org>
Subject: Re: Snapshot target and DAX-capable devices
Date: Tue, 28 Aug 2018 22:38:47 +0000	[thread overview]
Message-ID: <be0cc5947e91cb3d8dffb6ce5f26f93917c3ea29.camel@hpe.com> (raw)
In-Reply-To: <20180828175630.GA1197@redhat.com>

On Tue, 2018-08-28 at 13:56 -0400, Mike Snitzer wrote:
> On Tue, Aug 28 2018 at  3:50am -0400,
> Jan Kara <jack@suse.cz> wrote:
> 
> > On Mon 27-08-18 16:43:28, Kani, Toshi wrote:
> > > On Mon, 2018-08-27 at 18:07 +0200, Jan Kara wrote:
> > > > Hi,
> > > > 
> > > > I've been analyzing why fstest generic/081 fails when the backing device is
> > > > capable of DAX. The problem boils down to the failure of:
> > > > 
> > > > lvm vgcreate -f vg0 /dev/pmem0
> > > > lvm lvcreate -L 128M -n lv0 vg0
> > > > lvm lvcreate -s -L 4M -n snap0 vg0/lv0
> > > > 
> > > > The last command fails like:
> > > > 
> > > >   device-mapper: reload ioctl on (253:0) failed: Invalid argument
> > > >   Failed to lock logical volume vg0/lv0.
> > > >   Aborting. Manual intervention required.
> > > > 
> > > > And the core of the problem is that volume vg0/lv0 is originally of
> > > > DM_TYPE_DAX_BIO_BASED type but when the snapshot gets created, we try to
> > > > switch it to DM_TYPE_BIO_BASED because now the device stops supporting DAX.
> > > > The problem seems to be introduced by Ross' commit dbc626597 "dm: prevent
> > > > DAX mounts if not supported".
> > > > 
> > > > The question is whether / how this should be fixed. The current inability
> > > > to create snapshots of DAX-capable devices looks weird and the cryptic
> > > > failure makes it even worse (it took me quite a while to understand what is
> > > > failing and why). OTOH I see the rationale behind Ross' change as well.
> > > 
> > > Here are the dm-snap changes that went along with the original DAX
> > > support.
> > > 
> > > commit b5ab4a9ba55
> > > commit f6e629bd237
> > > 
> > > Basically, snapshots can be added/removed to DAX-capable devices, but
> > > snapshots need to be mounted without dax option.
> > 
> > Yes, and after these two commits things were working. But then commit
> > dbc626597 broke things again so currently snapshotting DAX-capable devices
> > does not work. Just try with 4.18...
> 
> Commit f6e629bd237 was a nasty hack, and commit dbc626597 exposed it as
> such.  But commit dbc626597 has caused us to regress.. so we need to fix
> it.
> 
> We could remove DM_TYPE_DAX_BIO_BASED completely.  But in the past I was
> reluctant to do so because it really is unclear how/if we can even
> support a device switching from DAX to non-DAX while IO is in-flight. DM
> supports suspending without flushing (via dmsetup suspend --noflush) and
> that could really be problematic if we leave DAX IO inflight and then
> switch the DM table such that the DM device no longer supports DAX.
> 
> I'm open to suggestions.

Right, commit f6e629bd237 is a hack, but I do not have a better idea at
this point...  For now, I am afraid that reverting commit dbc626597 may
be an option.

Thanks,
-Toshi

_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

WARNING: multiple messages have this Message-ID (diff)
From: "Kani, Toshi" <toshi.kani@hpe.com>
To: "jack@suse.cz" <jack@suse.cz>, "snitzer@redhat.com" <snitzer@redhat.com>
Cc: "dm-devel@redhat.com" <dm-devel@redhat.com>,
	"ross.zwisler@linux.intel.com" <ross.zwisler@linux.intel.com>,
	"linux-nvdimm@lists.01.org" <linux-nvdimm@lists.01.org>,
	"dan.j.williams@intel.com" <dan.j.williams@intel.com>,
	"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>
Subject: Re: Snapshot target and DAX-capable devices
Date: Tue, 28 Aug 2018 22:38:47 +0000	[thread overview]
Message-ID: <be0cc5947e91cb3d8dffb6ce5f26f93917c3ea29.camel@hpe.com> (raw)
In-Reply-To: <20180828175630.GA1197@redhat.com>

On Tue, 2018-08-28 at 13:56 -0400, Mike Snitzer wrote:
> On Tue, Aug 28 2018 at  3:50am -0400,
> Jan Kara <jack@suse.cz> wrote:
> 
> > On Mon 27-08-18 16:43:28, Kani, Toshi wrote:
> > > On Mon, 2018-08-27 at 18:07 +0200, Jan Kara wrote:
> > > > Hi,
> > > > 
> > > > I've been analyzing why fstest generic/081 fails when the backing device is
> > > > capable of DAX. The problem boils down to the failure of:
> > > > 
> > > > lvm vgcreate -f vg0 /dev/pmem0
> > > > lvm lvcreate -L 128M -n lv0 vg0
> > > > lvm lvcreate -s -L 4M -n snap0 vg0/lv0
> > > > 
> > > > The last command fails like:
> > > > 
> > > >   device-mapper: reload ioctl on (253:0) failed: Invalid argument
> > > >   Failed to lock logical volume vg0/lv0.
> > > >   Aborting. Manual intervention required.
> > > > 
> > > > And the core of the problem is that volume vg0/lv0 is originally of
> > > > DM_TYPE_DAX_BIO_BASED type but when the snapshot gets created, we try to
> > > > switch it to DM_TYPE_BIO_BASED because now the device stops supporting DAX.
> > > > The problem seems to be introduced by Ross' commit dbc626597 "dm: prevent
> > > > DAX mounts if not supported".
> > > > 
> > > > The question is whether / how this should be fixed. The current inability
> > > > to create snapshots of DAX-capable devices looks weird and the cryptic
> > > > failure makes it even worse (it took me quite a while to understand what is
> > > > failing and why). OTOH I see the rationale behind Ross' change as well.
> > > 
> > > Here are the dm-snap changes that went along with the original DAX
> > > support.
> > > 
> > > commit b5ab4a9ba55
> > > commit f6e629bd237
> > > 
> > > Basically, snapshots can be added/removed to DAX-capable devices, but
> > > snapshots need to be mounted without dax option.
> > 
> > Yes, and after these two commits things were working. But then commit
> > dbc626597 broke things again so currently snapshotting DAX-capable devices
> > does not work. Just try with 4.18...
> 
> Commit f6e629bd237 was a nasty hack, and commit dbc626597 exposed it as
> such.  But commit dbc626597 has caused us to regress.. so we need to fix
> it.
> 
> We could remove DM_TYPE_DAX_BIO_BASED completely.  But in the past I was
> reluctant to do so because it really is unclear how/if we can even
> support a device switching from DAX to non-DAX while IO is in-flight. DM
> supports suspending without flushing (via dmsetup suspend --noflush) and
> that could really be problematic if we leave DAX IO inflight and then
> switch the DM table such that the DM device no longer supports DAX.
> 
> I'm open to suggestions.

Right, commit f6e629bd237 is a hack, but I do not have a better idea at
this point...  For now, I am afraid that reverting commit dbc626597 may
be an option.

Thanks,
-Toshi


WARNING: multiple messages have this Message-ID (diff)
From: "Kani, Toshi" <toshi.kani-ZPxbGqLxI0U@public.gmane.org>
To: "jack-AlSwsSmVLrQ@public.gmane.org"
	<jack-AlSwsSmVLrQ@public.gmane.org>,
	"snitzer-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org"
	<snitzer-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Cc: "linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"dm-devel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org"
	<dm-devel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
	"linux-nvdimm-hn68Rpc1hR1g9hUCZPvPmw@public.gmane.org"
	<linux-nvdimm-hn68Rpc1hR1g9hUCZPvPmw@public.gmane.org>
Subject: Re: Snapshot target and DAX-capable devices
Date: Tue, 28 Aug 2018 22:38:47 +0000	[thread overview]
Message-ID: <be0cc5947e91cb3d8dffb6ce5f26f93917c3ea29.camel@hpe.com> (raw)
In-Reply-To: <20180828175630.GA1197-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>

On Tue, 2018-08-28 at 13:56 -0400, Mike Snitzer wrote:
> On Tue, Aug 28 2018 at  3:50am -0400,
> Jan Kara <jack-AlSwsSmVLrQ@public.gmane.org> wrote:
> 
> > On Mon 27-08-18 16:43:28, Kani, Toshi wrote:
> > > On Mon, 2018-08-27 at 18:07 +0200, Jan Kara wrote:
> > > > Hi,
> > > > 
> > > > I've been analyzing why fstest generic/081 fails when the backing device is
> > > > capable of DAX. The problem boils down to the failure of:
> > > > 
> > > > lvm vgcreate -f vg0 /dev/pmem0
> > > > lvm lvcreate -L 128M -n lv0 vg0
> > > > lvm lvcreate -s -L 4M -n snap0 vg0/lv0
> > > > 
> > > > The last command fails like:
> > > > 
> > > >   device-mapper: reload ioctl on (253:0) failed: Invalid argument
> > > >   Failed to lock logical volume vg0/lv0.
> > > >   Aborting. Manual intervention required.
> > > > 
> > > > And the core of the problem is that volume vg0/lv0 is originally of
> > > > DM_TYPE_DAX_BIO_BASED type but when the snapshot gets created, we try to
> > > > switch it to DM_TYPE_BIO_BASED because now the device stops supporting DAX.
> > > > The problem seems to be introduced by Ross' commit dbc626597 "dm: prevent
> > > > DAX mounts if not supported".
> > > > 
> > > > The question is whether / how this should be fixed. The current inability
> > > > to create snapshots of DAX-capable devices looks weird and the cryptic
> > > > failure makes it even worse (it took me quite a while to understand what is
> > > > failing and why). OTOH I see the rationale behind Ross' change as well.
> > > 
> > > Here are the dm-snap changes that went along with the original DAX
> > > support.
> > > 
> > > commit b5ab4a9ba55
> > > commit f6e629bd237
> > > 
> > > Basically, snapshots can be added/removed to DAX-capable devices, but
> > > snapshots need to be mounted without dax option.
> > 
> > Yes, and after these two commits things were working. But then commit
> > dbc626597 broke things again so currently snapshotting DAX-capable devices
> > does not work. Just try with 4.18...
> 
> Commit f6e629bd237 was a nasty hack, and commit dbc626597 exposed it as
> such.  But commit dbc626597 has caused us to regress.. so we need to fix
> it.
> 
> We could remove DM_TYPE_DAX_BIO_BASED completely.  But in the past I was
> reluctant to do so because it really is unclear how/if we can even
> support a device switching from DAX to non-DAX while IO is in-flight. DM
> supports suspending without flushing (via dmsetup suspend --noflush) and
> that could really be problematic if we leave DAX IO inflight and then
> switch the DM table such that the DM device no longer supports DAX.
> 
> I'm open to suggestions.

Right, commit f6e629bd237 is a hack, but I do not have a better idea at
this point...  For now, I am afraid that reverting commit dbc626597 may
be an option.

Thanks,
-Toshi

  reply	other threads:[~2018-08-28 22:38 UTC|newest]

Thread overview: 83+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-27 16:07 Snapshot target and DAX-capable devices Jan Kara
2018-08-27 16:07 ` Jan Kara
2018-08-27 16:07 ` Jan Kara
2018-08-27 16:43 ` Kani, Toshi
2018-08-27 16:43   ` Kani, Toshi
2018-08-27 16:43   ` Kani, Toshi
2018-08-28  7:50   ` Jan Kara
2018-08-28  7:50     ` Jan Kara
2018-08-28  7:50     ` Jan Kara
2018-08-28 17:56     ` Mike Snitzer
2018-08-28 17:56       ` Mike Snitzer
2018-08-28 17:56       ` Mike Snitzer
2018-08-28 22:38       ` Kani, Toshi [this message]
2018-08-28 22:38         ` Kani, Toshi
2018-08-28 22:38         ` Kani, Toshi
2018-08-30  9:30       ` Jan Kara
2018-08-30  9:30         ` Jan Kara
2018-08-30  9:30         ` Jan Kara
2018-08-30 18:49         ` Mike Snitzer
2018-08-30 18:49           ` Mike Snitzer
2018-08-30 18:49           ` Mike Snitzer
2018-08-30 19:32           ` Jeff Moyer
2018-08-30 19:32             ` Jeff Moyer
2018-08-30 19:32             ` Jeff Moyer
2018-08-30 19:47             ` Mikulas Patocka
2018-08-30 19:47               ` Mikulas Patocka
2018-08-30 19:47               ` Mikulas Patocka
2018-08-30 19:53               ` Jeff Moyer
2018-08-30 19:53                 ` Jeff Moyer
2018-08-30 19:53                 ` Jeff Moyer
2018-08-30 23:38               ` Dave Chinner
2018-08-30 23:38                 ` Dave Chinner
2018-08-30 23:38                 ` Dave Chinner
2018-08-31  9:42                 ` Jan Kara
2018-08-31  9:42                   ` Jan Kara
2018-08-31  9:42                   ` Jan Kara
2018-09-05  1:25                   ` Dave Chinner
2018-09-05  1:25                     ` Dave Chinner
2018-09-05  1:25                     ` Dave Chinner
2018-12-12 16:11                   ` Huaisheng Ye
2018-12-12 16:11                     ` Huaisheng Ye
2018-12-12 16:11                     ` Huaisheng Ye
2018-12-12 16:12                     ` Christoph Hellwig
2018-12-12 16:12                       ` Christoph Hellwig
2018-12-12 16:12                       ` Christoph Hellwig
2018-12-12 17:50                       ` Mike Snitzer
2018-12-12 17:50                         ` Mike Snitzer
2018-12-12 17:50                         ` Mike Snitzer
2018-12-12 19:49                         ` Kani, Toshi
2018-12-12 19:49                           ` Kani, Toshi
2018-12-12 19:49                           ` Kani, Toshi
2018-12-12 21:15                         ` Theodore Y. Ts'o
2018-12-12 21:15                           ` Theodore Y. Ts'o
2018-12-12 22:43                           ` Mike Snitzer
2018-12-12 22:43                             ` Mike Snitzer
2018-12-12 22:43                             ` Mike Snitzer
2018-12-14  4:11                             ` [dm-devel] " Theodore Y. Ts'o
2018-12-14  4:11                               ` Theodore Y. Ts'o
2018-12-14  4:11                               ` Theodore Y. Ts'o
2018-12-14  8:24                             ` [External] " Huaisheng HS1 Ye
2018-12-14  8:24                               ` Huaisheng HS1 Ye
2018-12-14  8:24                               ` Huaisheng HS1 Ye
2018-12-18 19:49                               ` Mike Snitzer
2018-12-18 19:49                                 ` Mike Snitzer
2018-12-18 19:49                                 ` Mike Snitzer
2018-08-30 19:44           ` Mikulas Patocka
2018-08-30 19:44             ` Mikulas Patocka
2018-08-30 19:44             ` Mikulas Patocka
2018-08-31 10:01             ` Jan Kara
2018-08-31 10:01               ` Jan Kara
2018-08-31 10:01               ` Jan Kara
2018-08-30 22:55           ` Dave Chinner
2018-08-30 22:55             ` Dave Chinner
2018-08-30 22:55             ` Dave Chinner
2018-08-31  9:54           ` Jan Kara
2018-08-31  9:54             ` Jan Kara
2018-08-31  9:54             ` Jan Kara
2018-08-30 19:17         ` [dm-devel] " Jeff Moyer
2018-08-30 19:17           ` Jeff Moyer
2018-08-30 19:17           ` Jeff Moyer
2018-08-31  9:14           ` Jan Kara
2018-08-31  9:14             ` Jan Kara
2018-08-31  9:14             ` Jan Kara

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=be0cc5947e91cb3d8dffb6ce5f26f93917c3ea29.camel@hpe.com \
    --to=toshi.kani@hpe.com \
    --cc=dm-devel@redhat.com \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-nvdimm@lists.01.org \
    --cc=snitzer@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.