From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from g4t3425.houston.hpe.com (g4t3425.houston.hpe.com [15.241.140.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 635912194D387 for ; Mon, 27 Aug 2018 09:43:34 -0700 (PDT) From: "Kani, Toshi" Subject: Re: Snapshot target and DAX-capable devices Date: Mon, 27 Aug 2018 16:43:28 +0000 Message-ID: References: <20180827160744.GE4002@quack2.suse.cz> In-Reply-To: <20180827160744.GE4002@quack2.suse.cz> Content-Language: en-US Content-ID: <090B267D40F391409D5CDE9EF74773E1@NAMPRD84.PROD.OUTLOOK.COM> MIME-Version: 1.0 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" To: "jack@suse.cz" , "linux-nvdimm@lists.01.org" Cc: "linux-fsdevel@vger.kernel.org" , "dm-devel@redhat.com" , "snitzer@redhat.com" List-ID: 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. Thanks, -Toshi _______________________________________________ Linux-nvdimm mailing list Linux-nvdimm@lists.01.org https://lists.01.org/mailman/listinfo/linux-nvdimm From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from g9t1613g.houston.hpe.com ([15.241.32.99]:6806 "EHLO g9t1613g.houston.hpe.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726995AbeH0Uay (ORCPT ); Mon, 27 Aug 2018 16:30:54 -0400 Received: from g4t3425.houston.hpe.com (g4t3425.houston.hpe.com [15.241.140.78]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by g9t1613g.houston.hpe.com (Postfix) with ESMTPS id A9ECD6060F for ; Mon, 27 Aug 2018 16:43:33 +0000 (UTC) From: "Kani, Toshi" To: "jack@suse.cz" , "linux-nvdimm@lists.01.org" CC: "dm-devel@redhat.com" , "ross.zwisler@linux.intel.com" , "dan.j.williams@intel.com" , "snitzer@redhat.com" , "linux-fsdevel@vger.kernel.org" Subject: Re: Snapshot target and DAX-capable devices Date: Mon, 27 Aug 2018 16:43:28 +0000 Message-ID: References: <20180827160744.GE4002@quack2.suse.cz> In-Reply-To: <20180827160744.GE4002@quack2.suse.cz> Content-Language: en-US Content-Type: text/plain; charset="utf-8" Content-ID: <090B267D40F391409D5CDE9EF74773E1@NAMPRD84.PROD.OUTLOOK.COM> Content-Transfer-Encoding: base64 MIME-Version: 1.0 Sender: linux-fsdevel-owner@vger.kernel.org List-ID: T24gTW9uLCAyMDE4LTA4LTI3IGF0IDE4OjA3ICswMjAwLCBKYW4gS2FyYSB3cm90ZToNCj4gSGks DQo+IA0KPiBJJ3ZlIGJlZW4gYW5hbHl6aW5nIHdoeSBmc3Rlc3QgZ2VuZXJpYy8wODEgZmFpbHMg d2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IGZpeGVk LiBUaGUgY3VycmVudCBpbmFiaWxpdHkNCj4gdG8gY3JlYXRlIHNuYXBzaG90cyBvZiBEQVgtY2Fw YWJsZSBkZXZpY2VzIGxvb2tzIHdlaXJkIGFuZCB0aGUgY3J5cHRpYw0KPiBmYWlsdXJlIG1ha2Vz IGl0IGV2ZW4gd29yc2UgKGl0IHRvb2sgbWUgcXVpdGUgYSB3aGlsZSB0byB1bmRlcnN0YW5kIHdo YXQgaXMNCj4gZmFpbGluZyBhbmQgd2h5KS4gT1RPSCBJIHNlZSB0aGUgcmF0aW9uYWxlIGJlaGlu ZCBSb3NzJyBjaGFuZ2UgYXMgd2VsbC4NCg0KSGVyZSBhcmUgdGhlIGRtLXNuYXAgY2hhbmdlcyB0 aGF0IHdlbnQgYWxvbmcgd2l0aCB0aGUgb3JpZ2luYWwgREFYDQpzdXBwb3J0Lg0KDQpjb21taXQg YjVhYjRhOWJhNTUNCmNvbW1pdCBmNmU2MjliZDIzNw0KDQpCYXNpY2FsbHksIHNuYXBzaG90cyBj YW4gYmUgYWRkZWQvcmVtb3ZlZCB0byBEQVgtY2FwYWJsZSBkZXZpY2VzLCBidXQNCnNuYXBzaG90 cyBuZWVkIHRvIGJlIG1vdW50ZWQgd2l0aG91dCBkYXggb3B0aW9uLg0KDQpUaGFua3MsDQotVG9z aGkNCg0KDQo= From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Kani, Toshi" Subject: Re: Snapshot target and DAX-capable devices Date: Mon, 27 Aug 2018 16:43:28 +0000 Message-ID: References: <20180827160744.GE4002@quack2.suse.cz> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20180827160744.GE4002-4I4JzKEfoa/jFM9bn6wA6Q@public.gmane.org> Content-Language: en-US Content-ID: <090B267D40F391409D5CDE9EF74773E1-mmYPd6ayCNGroOM5E8FhRbjFIynDaujOfM0AETQt39g@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linux-nvdimm-bounces-hn68Rpc1hR1g9hUCZPvPmw@public.gmane.org Sender: "Linux-nvdimm" To: "jack-AlSwsSmVLrQ@public.gmane.org" , "linux-nvdimm-hn68Rpc1hR1g9hUCZPvPmw@public.gmane.org" Cc: "linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , "dm-devel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org" , "snitzer-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org" List-Id: dm-devel.ids 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. Thanks, -Toshi