From: Michal Suchanek <msuchanek@suse.de>
To: linux-nvdimm@lists.01.org
Cc: Michal Suchanek <msuchanek@suse.de>,
Mikulas Patocka <mpatocka@redhat.com>,
"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, Pankaj Gupta <pagupta@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
Yuval Shaia <yuval.shaia@oracle.com>,
Cornelia Huck <cohuck@redhat.com>,
Jakub Staron <jstaron@google.com>,
linux-kernel@vger.kernel.org
Subject: [PATCH] dm writecache: reject asynchronous pmem.
Date: Tue, 30 Jun 2020 14:35:28 +0200 [thread overview]
Message-ID: <20200630123528.29660-1-msuchanek@suse.de> (raw)
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..57b0a972f6fd 100644
--- a/drivers/md/dm-writecache.c
+++ b/drivers/md/dm-writecache.c
@@ -2277,6 +2277,12 @@ static int writecache_ctr(struct dm_target *ti, unsigned argc, char **argv)
wc->memory_map_size -= (uint64_t)wc->start_sector << SECTOR_SHIFT;
+ if (!dax_synchronous(wc->ssd_dev->dax_dev)) {
+ r = -EOPNOTSUPP;
+ ti->error = "Asynchronous persistent memory not supported as pmem cache";
+ goto bad;
+ }
+
bio_list_init(&wc->flush_list);
wc->flush_thread = kthread_create(writecache_flush_thread, wc, "dm_writecache_flush");
if (IS_ERR(wc->flush_thread)) {
--
2.26.2
next reply other threads:[~2020-06-30 12:35 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-30 12:35 Michal Suchanek [this message]
2020-06-30 13:32 ` [PATCH] dm writecache: reject asynchronous pmem 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 ` [PATCH v3] " Michal Suchanek
2020-06-30 16:11 ` 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=20200630123528.29660-1-msuchanek@suse.de \
--to=msuchanek@suse.de \
--cc=agk@redhat.com \
--cc=aneesh.kumar@linux.ibm.com \
--cc=cohuck@redhat.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=pagupta@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).