From: Michal Suchanek <msuchanek@suse.de>
To: Mikulas Patocka <mpatocka@redhat.com>
Cc: Michal Suchanek <msuchanek@suse.de>,
linux-nvdimm@lists.01.org,
"Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>,
Jan Kara <jack@suse.cz>, Alasdair Kergon <agk@redhat.com>,
Mike Snitzer <snitzer@redhat.com>,
dm-devel@redhat.com, Jakub Staron <jstaron@google.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
Dan Williams <dan.j.williams@intel.com>,
Yuval Shaia <yuval.shaia@oracle.com>,
Cornelia Huck <cohuck@redhat.com>,
linux-kernel@vger.kernel.org
Subject: [PATCH v3] dm writecache: reject asynchronous pmem.
Date: Tue, 30 Jun 2020 17:49:24 +0200 [thread overview]
Message-ID: <20200630154924.3283-1-msuchanek@suse.de> (raw)
In-Reply-To: <alpine.LRH.2.02.2006301101210.24028@file01.intranet.prod.int.rdu2.redhat.com>
The writecache driver does not handle asynchronous pmem. Reject it when
supplied as cache.
Link: https://lore.kernel.org/linux-nvdimm/87lfk5hahc.fsf@linux.ibm.com/
Fixes: 6e84200c0a29 ("virtio-pmem: Add virtio pmem driver")
Signed-off-by: Michal Suchanek <msuchanek@suse.de>
---
drivers/md/dm-writecache.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/md/dm-writecache.c b/drivers/md/dm-writecache.c
index 30505d70f423..5358894bb9fd 100644
--- a/drivers/md/dm-writecache.c
+++ b/drivers/md/dm-writecache.c
@@ -2266,6 +2266,12 @@ static int writecache_ctr(struct dm_target *ti, unsigned argc, char **argv)
}
if (WC_MODE_PMEM(wc)) {
+ if (!dax_synchronous(wc->ssd_dev->dax_dev)) {
+ r = -EOPNOTSUPP;
+ ti->error = "Asynchronous persistent memory not supported as pmem cache";
+ goto bad;
+ }
+
r = persistent_memory_claim(wc);
if (r) {
ti->error = "Unable to map persistent memory for cache";
--
2.26.2
next prev parent reply other threads:[~2020-06-30 15:49 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-30 12:35 [PATCH] dm writecache: reject asynchronous pmem Michal Suchanek
2020-06-30 13:32 ` Mikulas Patocka
2020-06-30 14:10 ` Michal Suchánek
2020-06-30 13:36 ` Mike Snitzer
2020-06-30 14:43 ` Michal Suchánek
2020-06-30 14:53 ` [PATCH v2] " Michal Suchanek
2020-06-30 15:02 ` Mikulas Patocka
2020-06-30 15:49 ` Michal Suchanek [this message]
2020-06-30 16:11 ` [PATCH v3] " Mikulas Patocka
2020-06-30 16:14 ` Mikulas Patocka
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=20200630154924.3283-1-msuchanek@suse.de \
--to=msuchanek@suse.de \
--cc=agk@redhat.com \
--cc=aneesh.kumar@linux.ibm.com \
--cc=cohuck@redhat.com \
--cc=dan.j.williams@intel.com \
--cc=dm-devel@redhat.com \
--cc=jack@suse.cz \
--cc=jstaron@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvdimm@lists.01.org \
--cc=mpatocka@redhat.com \
--cc=mst@redhat.com \
--cc=snitzer@redhat.com \
--cc=yuval.shaia@oracle.com \
/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).