linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] dm writecache: reject asynchronous pmem.
@ 2020-06-30 12:35 Michal Suchanek
  2020-06-30 13:32 ` Mikulas Patocka
  0 siblings, 1 reply; 10+ messages in thread
From: Michal Suchanek @ 2020-06-30 12:35 UTC (permalink / raw)
  To: linux-nvdimm
  Cc: Michal Suchanek, Mikulas Patocka, Aneesh Kumar K.V, Jan Kara,
	Alasdair Kergon, Mike Snitzer, dm-devel, Pankaj Gupta,
	Michael S. Tsirkin, Yuval Shaia, Cornelia Huck, Jakub Staron,
	linux-kernel

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


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2020-06-30 16:14 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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           ` [PATCH v3] " Michal Suchanek
2020-06-30 16:11             ` Mikulas Patocka
2020-06-30 16:14               ` Mikulas Patocka

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).