From patchwork Tue Nov 20 10:20:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Huaisheng Ye X-Patchwork-Id: 10692181 X-Patchwork-Delegate: snitzer@redhat.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BAFC713AD for ; Wed, 21 Nov 2018 09:28:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A68272B80C for ; Wed, 21 Nov 2018 09:28:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9A62B2B814; Wed, 21 Nov 2018 09:28:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 430842B80C for ; Wed, 21 Nov 2018 09:28:04 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 302D1307D84C; Wed, 21 Nov 2018 09:28:03 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0152F705B2; Wed, 21 Nov 2018 09:28:03 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id AC06F181B9EB; Wed, 21 Nov 2018 09:28:02 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id wAKALUZN017237 for ; Tue, 20 Nov 2018 05:21:30 -0500 Received: by smtp.corp.redhat.com (Postfix) id 9CFCD179D1; Tue, 20 Nov 2018 10:21:30 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx11.extmail.prod.ext.phx2.redhat.com [10.5.110.40]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8A5825D979; Tue, 20 Nov 2018 10:21:30 +0000 (UTC) Received: from sender-pp-092.zoho.com (sender-pp-092.zoho.com [135.84.80.237]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 650D3312E9D2; Tue, 20 Nov 2018 10:21:29 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; t=1542709287; cv=none; d=zoho.com; s=zohoarc; b=Q7EuFKCNpEWAFLIJlK1cYneAB4xYIifVbUUi9l8/RjQrpQviuBKzOCtoUjJvoGgPosswQmzvmj6t1gHWZfS2PKRC6N/2vILDPki/ROPHjmeWekZ2o+QjHKIqbr/KZe93a/hyolZJzwLlPkznZlYUrqvMPrNx9nqG/1/MBDrtCA8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1542709287; h=Cc:Date:From:In-Reply-To:Message-ID:References:Subject:To:ARC-Authentication-Results; bh=GHh1ilgk8ZdCIo8lwzMZINvkNuuU7rjdcC8nSOe4YS4=; b=JshvvVSeKvGq0W/MWkOgV+lolwe2BMjrC3sLidUqWK3Bo+sB3qG2Hr4gzNRyYzKpFF5WjO0TEwP/vccfPxkQLR2IKL92HlBxBZmdddppV3IKFGQUrHlZJ2sHjCG+mrD1yQ/hA1H3NpENkeNEK7/HlgkT4Dq4SB03uEvo3sXhivM= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass header.i=zoho.com; spf=pass smtp.mailfrom=yehs2007@zoho.com; dmarc=pass header.from= header.from= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=zapps768; d=zoho.com; h=from:to:cc:subject:date:message-id:in-reply-to:references; b=PRJ0BZSCl2Y8jcBUX2b/SG3G/ZvQrI6I+sn0PcFlqFv5j5PGuH1N3v/aFmGteNYF4RGgd8QIWuL0 Ex77TMkB9phPhE8WrsmyoLqSgYDfTvCCTmoolMV3FGPeQzt/XziZ DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1542709287; s=default; d=zoho.com; i=yehs2007@zoho.com; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; l=1150; bh=GHh1ilgk8ZdCIo8lwzMZINvkNuuU7rjdcC8nSOe4YS4=; b=KGazHKFwhgtqQqo0CnoGftEYRLjZZyaVGcZQhFwzeyu85rMJ+IwjMcC2L95uT1ly xNeB2Nhm6zwXFaiG7hvm0p0wD0jLj902qYvePAY/pv/iGMnkUaWOq42CXLXRGX4P7kG MZU8E34kVC0JVY/nakZLsMV/+POExLGudTI1O2hc= Received: from YEHS1XR956R00D1.lenovo.com (58.243.153.247 [58.243.153.247]) by mx.zohomail.com with SMTPS id 1542709286690283.4299240192355; Tue, 20 Nov 2018 02:21:26 -0800 (PST) From: Huaisheng Ye To: linux-nvdimm@lists.01.org, agk@redhat.com, snitzer@redhat.com, dm-devel@redhat.com, dan.j.williams@intel.com, willy@infradead.org, zwisler@kernel.org, jack@suse.cz, dave.jiang@intel.com, vishal.l.verma@intel.com Date: Tue, 20 Nov 2018 18:20:37 +0800 Message-Id: <20181120102037.4536-4-yehs2007@zoho.com> In-Reply-To: <20181120102037.4536-1-yehs2007@zoho.com> References: <20181120102037.4536-1-yehs2007@zoho.com> X-ZohoMailClient: External X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 216 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Tue, 20 Nov 2018 10:21:29 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Tue, 20 Nov 2018 10:21:29 +0000 (UTC) for IP:'135.84.80.237' DOMAIN:'sender-pp-092.zoho.com' HELO:'sender-pp-092.zoho.com' FROM:'yehs2007@zoho.com' RCPT:'' X-RedHat-Spam-Score: 0.14 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_PASS) 135.84.80.237 sender-pp-092.zoho.com 135.84.80.237 sender-pp-092.zoho.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.40 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: dm-devel@redhat.com X-Mailman-Approved-At: Wed, 21 Nov 2018 04:27:48 -0500 Cc: linux-fsdevel@vger.kernel.org, chengnt@lenovo.com, linux-kernel@vger.kernel.org, Huaisheng Ye Subject: [dm-devel] [RFC PATCH 3/3] dm: expand valid types for dm-ioctl X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Wed, 21 Nov 2018 09:28:03 +0000 (UTC) X-Virus-Scanned: ClamAV using ClamSMTP From: Huaisheng Ye If use DAX way to mount the origin device of dm_snapshot, when merging back snapshot to origin, system call table_load during the construction of snapshot-merge will try to detect new dm_table's type equals to the existed md's type or not. The existed type equals to DM_TYPE_DAX_BIO_BASED, but the new created type belongs to DM_TYPE_BIO_BASED. So, we need to expand valid_type in function is_valid_type. Signed-off-by: Huaisheng Ye --- drivers/md/dm-ioctl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c index a27016e..158d657 100644 --- a/drivers/md/dm-ioctl.c +++ b/drivers/md/dm-ioctl.c @@ -1295,7 +1295,8 @@ static int populate_table(struct dm_table *table, static bool is_valid_type(enum dm_queue_mode cur, enum dm_queue_mode new) { if (cur == new || - (cur == DM_TYPE_BIO_BASED && new == DM_TYPE_DAX_BIO_BASED)) + (cur == DM_TYPE_BIO_BASED && new == DM_TYPE_DAX_BIO_BASED) || + (cur == DM_TYPE_DAX_BIO_BASED && new == DM_TYPE_BIO_BASED)) return true; return false;