From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752138AbcF2PTN (ORCPT ); Wed, 29 Jun 2016 11:19:13 -0400 Received: from mail-by2on0134.outbound.protection.outlook.com ([207.46.100.134]:21056 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752725AbcF2PTI (ORCPT ); Wed, 29 Jun 2016 11:19:08 -0400 From: "Kani, Toshimitsu" To: "snitzer@redhat.com" CC: "linux-raid@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "dan.j.williams@intel.com" , "dm-devel@redhat.com" , "linux-nvdimm@ml01.01.org" , "agk@redhat.com" Subject: Re: [PATCH 1/2] dm: update table type check for dax Thread-Topic: [PATCH 1/2] dm: update table type check for dax Thread-Index: AQHR0XSKLq06tkq2ZUOWgsP7GEmeG5//TmuAgAAEfACAAEfzgIAA9VoA Date: Wed, 29 Jun 2016 15:19:05 +0000 Message-ID: <1467213538.3504.442.camel@hpe.com> References: <1467142636-21094-1-git-send-email-toshi.kani@hpe.com> <1467142636-21094-2-git-send-email-toshi.kani@hpe.com> <20160628200714.GC8300@redhat.com> <1467145398.3504.439.camel@hpe.com> <20160629004049.GA9721@redhat.com> In-Reply-To: <20160629004049.GA9721@redhat.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=toshi.kani@hpe.com; x-originating-ip: [15.219.163.9] x-ms-office365-filtering-correlation-id: fff22dae-b253-41f1-f914-08d3a030b59b x-microsoft-exchange-diagnostics: 1;CS1PR84MB0007;6:WU/z3LfRILjPqTInYrW0po9s6Mh9FVmNRN5nqGJo3rdslM1l/0yLa2F5Lxv+IgB2e2on6TK1o0mnYkPb1IJhg08kGnrRYC9HSnsFBnJcfoplIzVO8SqUZqtJbyAVpxWojXD21vJ4UaClMSwTC69kcWXdukcB0xR2BLSsH5kizbmGYeLZWXSEKEMs8/kOluxQ5Mym3ZCRw0YrRc2oKJ3TQdCiqL98gil08u6EzrOTaAWO54+RzgfV5b1y5Z8tDKFSB7EIfLwqgqw1NUv4QBLUx/cgZi26CqJz7nbXjJXQRsE=;5:B7C+Ov9Idfz6LxcVbWCbI201zwDuRk0Y1sKWqDd5H3Dd2SyBvQikE4UN0bQ3+GoYHwHaIuOK3fO5esBNZGP/NLo1d1LIuL2qVBcR0YrzriwPBJifaLXfSolhcuwNR4/0Bp6AGYllCyG/KqRfZr/WTA==;24:XvzQjpfQUh6XPaKkD7wbsnJM4Zj35ITxh2WePW6eTA1ANOdnaE8oQPWfOwKpwPY4Ojy61BqmgcZehRWEJ+2xjW0Mg4qEcnEkFRySsojn45A=;7:YNKbSR0QRwfxFdCIS27keS68ZyHNLKp9HmEJaw1fzO4x30XDq/nrIuG94fS47ghQZLF6LxDrHjhWCm+Tb5yys8cI9AVRTbXjrVd/WwiK5KRks47nMpfljgtz2L94W4EIVuFVqAyXyaMyAvqEfG/TktrrQr74nUufL2poJ8yaM570JucbosFUAlqBedrlJm1O9TO1EA3nt/IAUeh1Ue2g9BRgeOhADhBTs6SNWpnslFdRn2Kbwau3G44SPadhgEgN x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CS1PR84MB0007; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(227479698468861); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046);SRVR:CS1PR84MB0007;BCL:0;PCL:0;RULEID:;SRVR:CS1PR84MB0007; x-forefront-prvs: 09888BC01D x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(7916002)(377424004)(189002)(199003)(24454002)(11100500001)(87936001)(5002640100001)(8936002)(36756003)(33646002)(3660700001)(102836003)(106116001)(77096005)(3846002)(110136002)(586003)(97736004)(99286002)(122556002)(2900100001)(106356001)(76176999)(2950100001)(6116002)(93886004)(105586002)(305945005)(101416001)(86362001)(8676002)(4326007)(103116003)(189998001)(5640700001)(2501003)(54356999)(81156014)(1730700003)(66066001)(2351001)(81166006)(68736007)(19580405001)(19580395003)(50986999)(92566002)(2906002)(3280700002)(10400500002)(7736002)(7846002);DIR:OUT;SFP:1102;SCL:1;SRVR:CS1PR84MB0007;H:CS1PR84MB0005.NAMPRD84.PROD.OUTLOOK.COM;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="utf-8" Content-ID: <55DC4A9F57B87C4B8A7431721C9D1254@NAMPRD84.PROD.OUTLOOK.COM> MIME-Version: 1.0 X-OriginatorOrg: hpe.com X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Jun 2016 15:19:05.4263 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 105b2061-b669-4b31-92ac-24d304d195dc X-MS-Exchange-Transport-CrossTenantHeadersStamped: CS1PR84MB0007 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id u5TFJMGK020695 On Tue, 2016-06-28 at 20:40 -0400, Mike Snitzer wrote: > On Tue, Jun 28 2016 at  4:23pm -0400, > Kani, Toshimitsu wrote: > > > On Tue, 2016-06-28 at 16:07 -0400, Mike Snitzer wrote: > > > > > > On Tue, Jun 28 2016 at  3:37pm -0400, > > > Toshi Kani wrote: > >  : > > > > > > You said in the 0th header: "Patch 1 solves an error when lvremove is > > > made to a snapshot device." > > > > > > I'm not seeing why this patch 1 fixes anything specific to snapshot > > > device removal (but I can see why patch 2 makes snapshot creation > > > "work").  I'll apply your 2nd patch and see if I can see what you mean. > > > > > > I actually see this error, without either of your 2 proposed patches > > > applied, when I try to create a snapshot of a DAX capable LV: > > > > > > # lvcreate -s -n snap -L 100M pmem/lv > > >   device-mapper: reload ioctl on (253:7) failed: Invalid argument > > >   Failed to lock logical volume pmem/lv. > > >   Aborting. Manual intervention required. > > > Jun 28 15:57:28 rhel-storage-02 kernel: device-mapper: ioctl: can't > > > change device type after initial table load. > > > > Yes, patch 2 fixes this error. > > > > I have not looked into why lvremove does this, but lvremove to a snapshot > > device fails to reload DM table of "-lvsnap" device (which is marked > > as DM_TYPE_BIO_BASED) with DM_TYPE_DAX_BIO_BASED.  Patch 1 fixes this > > error. > > It looks like a strange intermediate state that lvm2 uses during > snapshot removal. > > Full listing of snapshot related DM tables (before lvremove): > > pmem-lv-real: 0 6086656 linear 259:0 2048 > pmem-lv: 0 6086656 snapshot-origin 253:5 > pmem-snap-cow: 0 204800 linear 259:0 6088704 > pmem-snap: 0 6086656 snapshot 253:5 253:6 P 8 > > When removing this snapshot we're wanting to be left with: > > pmem-lv: 0 6086656 linear 259:0 2048 > > I augmented the DM core error to be more expressive, resulting in: >   device-mapper: ioctl: 253:7: can't change device type (from 1 to 4) after > initial table load. > > 1 is DM_TYPE_BIO_BASED and 4 is DM_TYPE_DAX_BIO_BASED -- which makes > sense given the linear target is DM_TYPE_DAX_BIO_BASED. > > The previous DM table for 253:7 was: >   pmem-snap: 0 6086656 snapshot 253:5 253:6 P 8 > > The intermediate table that lvm2 is trying to load for 253:7 is: >   0 204800 linear 259:0 6088704 > > (this linear target was previously pmem-snap-cow) Yes, that is consistent with what I saw. > > > > I think it also generally makes sense to allow this case. > > You're probably right but I need to think about it a little bit more. Sounds good. Thanks! -Toshi