[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LRH.2.02.2006301101210.24028@file01.intranet.prod.int.rdu2.redhat.com>
Date: Tue, 30 Jun 2020 11:02:19 -0400 (EDT)
From: Mikulas Patocka <mpatocka@...hat.com>
To: Michal Suchanek <msuchanek@...e.de>
cc: linux-nvdimm@...ts.01.org,
"Aneesh Kumar K.V" <aneesh.kumar@...ux.ibm.com>,
Jan Kara <jack@...e.cz>, Alasdair Kergon <agk@...hat.com>,
Mike Snitzer <snitzer@...hat.com>, dm-devel@...hat.com,
Yuval Shaia <yuval.shaia@...cle.com>,
Dan Williams <dan.j.williams@...el.com>,
Cornelia Huck <cohuck@...hat.com>,
Pankaj Gupta <pagupta@...hat.com>,
Jakub Staron <jstaron@...gle.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] dm writecache: reject asynchronous pmem.
On Tue, 30 Jun 2020, Michal Suchanek wrote:
> 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@...e.de>
OK. I suggest to move this test before persistent_memory_claim (so that
you don't try to map the whole device).
Mikulas
> ---
> 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
>
Powered by blists - more mailing lists