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

* Re: [PATCH] dm writecache: reject asynchronous pmem.
  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
  0 siblings, 1 reply; 10+ messages in thread
From: Mikulas Patocka @ 2020-06-30 13:32 UTC (permalink / raw)
  To: Michal Suchanek
  Cc: linux-nvdimm, 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



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@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)) {
> -- 

Hi

Shouldn't this be in the "if (WC_MODE_PMEM(wc))" block?

WC_MODE_PMEM(wc) retrurns true if we are using persistent memory as a 
cache device, otherwise we are using generic block device as a cache 
device.

Mikulas


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

* Re: dm writecache: reject asynchronous pmem.
  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
  0 siblings, 2 replies; 10+ messages in thread
From: Mike Snitzer @ 2020-06-30 13:36 UTC (permalink / raw)
  To: Michal Suchánek
  Cc: Mikulas Patocka, linux-nvdimm, Aneesh Kumar K.V, Jan Kara,
	Alasdair Kergon, dm-devel, Michael S. Tsirkin, Yuval Shaia,
	Cornelia Huck, Jakub Staron, linux-kernel

On Tue, Jun 30 2020 at 10:10am -0400,
Michal Suchánek <msuchanek@suse.de> wrote:

> On Tue, Jun 30, 2020 at 09:32:01AM -0400, Mikulas Patocka wrote:
> > 
> > 
> > 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@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)) {
> > > -- 
> > 
> > Hi
> > 
> > Shouldn't this be in the "if (WC_MODE_PMEM(wc))" block?
> That should be always the case at this point.
> > 
> > WC_MODE_PMEM(wc) retrurns true if we are using persistent memory as a 
> > cache device, otherwise we are using generic block device as a cache 
> > device.
>
> This is to prevent the situation where we have WC_MODE_PMEM(wc) but
> cannot guarantee consistency because the async flush is not handled.

The writecache operates in 2 modes.  SSD or PMEM.  Mikulas is saying
your dax_synchronous() check should go within a WC_MODE_PMEM(wc) block
because it doesn't make sense to do the check when in SSD mode.

Mike


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

* Re: [PATCH] dm writecache: reject asynchronous pmem.
  2020-06-30 13:32 ` Mikulas Patocka
@ 2020-06-30 14:10   ` Michal Suchánek
  2020-06-30 13:36     ` Mike Snitzer
  0 siblings, 1 reply; 10+ messages in thread
From: Michal Suchánek @ 2020-06-30 14:10 UTC (permalink / raw)
  To: Mikulas Patocka
  Cc: linux-nvdimm, 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

On Tue, Jun 30, 2020 at 09:32:01AM -0400, Mikulas Patocka wrote:
> 
> 
> 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@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)) {
> > -- 
> 
> Hi
> 
> Shouldn't this be in the "if (WC_MODE_PMEM(wc))" block?
That should be always the case at this point.
> 
> WC_MODE_PMEM(wc) retrurns true if we are using persistent memory as a 
> cache device, otherwise we are using generic block device as a cache 
> device.
This is to prevent the situation where we have WC_MODE_PMEM(wc) but
cannot guarantee consistency because the async flush is not handled.

Thanks

Michal

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

* Re: dm writecache: reject asynchronous pmem.
  2020-06-30 13:36     ` Mike Snitzer
@ 2020-06-30 14:43       ` Michal Suchánek
  2020-06-30 14:53       ` [PATCH v2] " Michal Suchanek
  1 sibling, 0 replies; 10+ messages in thread
From: Michal Suchánek @ 2020-06-30 14:43 UTC (permalink / raw)
  To: Mike Snitzer
  Cc: Mikulas Patocka, linux-nvdimm, Aneesh Kumar K.V, Jan Kara,
	Alasdair Kergon, dm-devel, Michael S. Tsirkin, Yuval Shaia,
	Cornelia Huck, Jakub Staron, linux-kernel

On Tue, Jun 30, 2020 at 09:36:33AM -0400, Mike Snitzer wrote:
> On Tue, Jun 30 2020 at 10:10am -0400,
> Michal Suchánek <msuchanek@suse.de> wrote:
> 
> > On Tue, Jun 30, 2020 at 09:32:01AM -0400, Mikulas Patocka wrote:
> > > 
> > > 
> > > 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@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)) {
> > > > -- 
> > > 
> > > Hi
> > > 
> > > Shouldn't this be in the "if (WC_MODE_PMEM(wc))" block?
> > That should be always the case at this point.
> > > 
> > > WC_MODE_PMEM(wc) retrurns true if we are using persistent memory as a 
> > > cache device, otherwise we are using generic block device as a cache 
> > > device.
> >
> > This is to prevent the situation where we have WC_MODE_PMEM(wc) but
> > cannot guarantee consistency because the async flush is not handled.
> 
> The writecache operates in 2 modes.  SSD or PMEM.  Mikulas is saying
> your dax_synchronous() check should go within a WC_MODE_PMEM(wc) block
> because it doesn't make sense to do the check when in SSD mode.

Indeed, it's in the wrong if/else branch.

Thanks

Michal

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

* [PATCH v2] dm writecache: reject asynchronous pmem.
  2020-06-30 13:36     ` Mike Snitzer
  2020-06-30 14:43       ` Michal Suchánek
@ 2020-06-30 14:53       ` Michal Suchanek
  2020-06-30 15:02         ` Mikulas Patocka
  1 sibling, 1 reply; 10+ messages in thread
From: Michal Suchanek @ 2020-06-30 14:53 UTC (permalink / raw)
  Cc: Michal Suchanek, Mikulas Patocka, linux-nvdimm, Aneesh Kumar K.V,
	Jan Kara, Alasdair Kergon, Mike Snitzer, dm-devel, Yuval Shaia,
	Dan Williams, Cornelia Huck, Pankaj Gupta, 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..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


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

* Re: [PATCH v2] dm writecache: reject asynchronous pmem.
  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
  0 siblings, 1 reply; 10+ messages in thread
From: Mikulas Patocka @ 2020-06-30 15:02 UTC (permalink / raw)
  To: Michal Suchanek
  Cc: linux-nvdimm, Aneesh Kumar K.V, Jan Kara, Alasdair Kergon,
	Mike Snitzer, dm-devel, Yuval Shaia, Dan Williams, Cornelia Huck,
	Pankaj Gupta, Jakub Staron, linux-kernel



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@suse.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
> 


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

* [PATCH v3] dm writecache: reject asynchronous pmem.
  2020-06-30 15:02         ` Mikulas Patocka
@ 2020-06-30 15:49           ` Michal Suchanek
  2020-06-30 16:11             ` Mikulas Patocka
  0 siblings, 1 reply; 10+ messages in thread
From: Michal Suchanek @ 2020-06-30 15:49 UTC (permalink / raw)
  To: Mikulas Patocka
  Cc: Michal Suchanek, linux-nvdimm, Aneesh Kumar K.V, Jan Kara,
	Alasdair Kergon, Mike Snitzer, dm-devel, Jakub Staron,
	Michael S. Tsirkin, Dan Williams, Yuval Shaia, Cornelia Huck,
	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..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


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

* Re: [PATCH v3] dm writecache: reject asynchronous pmem.
  2020-06-30 15:49           ` [PATCH v3] " Michal Suchanek
@ 2020-06-30 16:11             ` Mikulas Patocka
  2020-06-30 16:14               ` Mikulas Patocka
  0 siblings, 1 reply; 10+ messages in thread
From: Mikulas Patocka @ 2020-06-30 16:11 UTC (permalink / raw)
  To: Michal Suchanek
  Cc: linux-nvdimm, Aneesh Kumar K.V, Jan Kara, Alasdair Kergon,
	Mike Snitzer, dm-devel, Jakub Staron, Michael S. Tsirkin,
	Dan Williams, Yuval Shaia, Cornelia Huck, linux-kernel



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@suse.de>

Acked-by: Mikulas Patocka <mpatocka@redhat.com>

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


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

* Re: [PATCH v3] dm writecache: reject asynchronous pmem.
  2020-06-30 16:11             ` Mikulas Patocka
@ 2020-06-30 16:14               ` Mikulas Patocka
  0 siblings, 0 replies; 10+ messages in thread
From: Mikulas Patocka @ 2020-06-30 16:14 UTC (permalink / raw)
  To: Michal Suchanek
  Cc: linux-nvdimm, Aneesh Kumar K.V, Jan Kara, Alasdair Kergon,
	Mike Snitzer, dm-devel, Jakub Staron, Michael S. Tsirkin,
	Dan Williams, Yuval Shaia, Cornelia Huck, linux-kernel



On Tue, 30 Jun 2020, Mikulas Patocka wrote:

> 
> 
> 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@suse.de>
> 
> Acked-by: Mikulas Patocka <mpatocka@redhat.com>

BTW, we should also add

Cc: stable@vger.kernel.org	# v5.3+

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


^ permalink raw reply	[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).