From: Huaisheng Ye <yehs2007@zoho.com>
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
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
chengnt@lenovo.com, Huaisheng Ye <yehs1@lenovo.com>
Subject: [RFC PATCH v2 3/3] dm: expand valid types for dm-ioctl
Date: Wed, 21 Nov 2018 11:27:02 +0800 [thread overview]
Message-ID: <20181121032702.3048-4-yehs2007@zoho.com> (raw)
In-Reply-To: <20181121032702.3048-1-yehs2007@zoho.com>
From: Huaisheng Ye <yehs1@lenovo.com>
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 <yehs1@lenovo.com>
---
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;
--
1.8.3.1
next prev parent reply other threads:[~2018-11-21 3:28 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-21 3:26 [RFC PATCH v2 0/3] realize dax_operations for dm-snapshot Huaisheng Ye
2018-11-21 3:27 ` [RFC PATCH v2 1/3] dm: enable " Huaisheng Ye
2018-11-21 3:27 ` [RFC PATCH v2 2/3] dm: expand hc_map in mapped_device for lack of map Huaisheng Ye
2018-11-21 3:27 ` Huaisheng Ye [this message]
2018-11-25 20:59 ` [RFC PATCH v2 0/3] realize dax_operations for dm-snapshot Dan Williams
2018-11-28 14:27 ` [External] " Huaisheng HS1 Ye
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181121032702.3048-4-yehs2007@zoho.com \
--to=yehs2007@zoho.com \
--cc=agk@redhat.com \
--cc=chengnt@lenovo.com \
--cc=dan.j.williams@intel.com \
--cc=dave.jiang@intel.com \
--cc=dm-devel@redhat.com \
--cc=jack@suse.cz \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvdimm@lists.01.org \
--cc=snitzer@redhat.com \
--cc=vishal.l.verma@intel.com \
--cc=willy@infradead.org \
--cc=yehs1@lenovo.com \
--cc=zwisler@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).