From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.suse.de ([195.135.220.15]:47752 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726567AbeH1Lst (ORCPT ); Tue, 28 Aug 2018 07:48:49 -0400 Date: Tue, 28 Aug 2018 09:50:25 +0200 From: Jan Kara To: "Kani, Toshi" Cc: "jack@suse.cz" , "linux-nvdimm@lists.01.org" , "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 Message-ID: <20180828075025.GA17756@quack2.suse.cz> References: <20180827160744.GE4002@quack2.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-fsdevel-owner@vger.kernel.org List-ID: 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... Honza -- Jan Kara SUSE Labs, CR