From patchwork Wed Nov 21 03:27:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Huaisheng Ye X-Patchwork-Id: 10691729 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 ED7EB13BB for ; Wed, 21 Nov 2018 03:27:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D7D272B40C for ; Wed, 21 Nov 2018 03:27:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CC63C2B413; Wed, 21 Nov 2018 03:27:35 +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=-2.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (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 88F0B2B40C for ; Wed, 21 Nov 2018 03:27:35 +0000 (UTC) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 80756211935BD; Tue, 20 Nov 2018 19:27:35 -0800 (PST) X-Original-To: linux-nvdimm@lists.01.org Delivered-To: linux-nvdimm@lists.01.org Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=135.84.80.237; helo=sender-pp-092.zoho.com; envelope-from=yehs2007@zoho.com; receiver=linux-nvdimm@lists.01.org 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 ml01.01.org (Postfix) with ESMTPS id D6DBE2097F57C for ; Tue, 20 Nov 2018 19:27:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542770850; cv=none; d=zoho.com; s=zohoarc; b=HqRpAU2QJYFlyRlP2HAtbKV5Nkbgm3zs8K+e1epfj5F6EU/KaBGwGutx9fUrkRwqdM+K3ixiNGoTSdKw43TkCBElveD1iXbekHGLq4oEhY1/9xxH9QteVI5prnPcTSPhWnEqba1oOUOsO6qdJn8XFy6sTCFHdRjMDsEQRAGdJqM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1542770850; h=Cc:Date:From:In-Reply-To:Message-ID:References:Subject:To:ARC-Authentication-Results; bh=GHh1ilgk8ZdCIo8lwzMZINvkNuuU7rjdcC8nSOe4YS4=; b=P/a36/jZXuJd0zloqWt9aVZn/hOpSUSUDvSPegyT5N3WnY3cpERjhuo01PH3xKHGZ86zFyyBM7MFR7Vkj2Cvsm04VMdR8HUnVd26PvcWfSpq/PhdwqP60FF0rUXcOnoR4gETgaOkI59kbbUHFyE2uqn88Twu+9Rj42N9j8euIgM= 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=HonwnfQeTzGWRJf/BUR7ZCsjCnI8jY1YspYxRXqdc0ZHqlNqWWW0h3B1bjrGPrbu+nAv/EWjWP5C Tp2azGgUK+MVMQDYXh6GebWB5lCjurMoNtDIszAyIiJ6XdXJmmL6 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1542770850; 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=M6Lvmv/VwGyYT4m0e+UOt/Xn6zEzHb3MVK6vPfb5c+8ZK3PxFcik5ACEe/2wlbnP Heu75WHAXyQ7qPguULix8PdXsfLzHQp9xcfFYKFXk4H5muFSeyDsjWbkpxSCJ690lsL M+AoAl0Q4trWC2dRCAryGb72bvYFXM7XgjtZ6SEc= Received: from YEHS1XR956R00D1.lenovo.com (58.243.153.247 [58.243.153.247]) by mx.zohomail.com with SMTPS id 1542770848969100.83345673388703; Tue, 20 Nov 2018 19:27:28 -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 Subject: [RFC PATCH v2 3/3] dm: expand valid types for dm-ioctl Date: Wed, 21 Nov 2018 11:27:02 +0800 Message-Id: <20181121032702.3048-4-yehs2007@zoho.com> X-Mailer: git-send-email 2.17.0.windows.1 In-Reply-To: <20181121032702.3048-1-yehs2007@zoho.com> References: <20181121032702.3048-1-yehs2007@zoho.com> X-ZohoMailClient: External X-BeenThere: linux-nvdimm@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Linux-nvdimm developer list." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-fsdevel@vger.kernel.org, chengnt@lenovo.com, linux-kernel@vger.kernel.org MIME-Version: 1.0 Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" 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;