Linux-NVDIMM Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Suchanek <msuchanek@suse.de>
Cc: Michal Suchanek <msuchanek@suse.de>,
	Mikulas Patocka <mpatocka@redhat.com>,
	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, Yuval Shaia <yuval.shaia@oracle.com>,
	Cornelia Huck <cohuck@redhat.com>,
	Jakub Staron <jstaron@google.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH v2] dm writecache: reject asynchronous pmem.
Date: Tue, 30 Jun 2020 16:53:35 +0200	[thread overview]
Message-ID: <20200630145335.1185-1-msuchanek@suse.de> (raw)
In-Reply-To: <20200630133546.GA20439@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..1e4f37249e28 100644
--- a/drivers/md/dm-writecache.c
+++ b/drivers/md/dm-writecache.c
@@ -2271,6 +2271,12 @@ static int writecache_ctr(struct dm_target *ti, unsigned argc, char **argv)
 			ti->error = "Unable to map persistent memory for cache";
 			goto bad;
 		}
+
+		if (!dax_synchronous(wc->ssd_dev->dax_dev)) {
+			r = -EOPNOTSUPP;
+			ti->error = "Asynchronous persistent memory not supported as pmem cache";
+			goto bad;
+		}
 	} else {
 		size_t n_blocks, n_metadata_blocks;
 		uint64_t n_bitmap_bits;
-- 
2.26.2
_______________________________________________
Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
To unsubscribe send an email to linux-nvdimm-leave@lists.01.org

  parent reply	other threads:[~2020-06-30 14:53 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       ` Michal Suchanek [this message]
2020-06-30 15:02         ` [PATCH v2] " 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=20200630145335.1185-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=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