linux-nvdimm.lists.01.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] libnvdimm/region: Update is_nvdimm_sync check to handle volatile regions
@ 2019-09-24 11:43 Aneesh Kumar K.V
  2019-09-24 11:52 ` Pankaj Gupta
  2019-09-24 16:57 ` Dan Williams
  0 siblings, 2 replies; 5+ messages in thread
From: Aneesh Kumar K.V @ 2019-09-24 11:43 UTC (permalink / raw)
  To: dan.j.williams; +Cc: Aneesh Kumar K.V, linux-nvdimm

We should consider volatile regions synchronous so that we are resilient to
OS crashes. This is needed when we have hypervisor like KVM exporting a ramdisk
as pmem dimms.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
---
 drivers/nvdimm/region_devs.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/nvdimm/region_devs.c b/drivers/nvdimm/region_devs.c
index ab91890f2486..ef423ba1a711 100644
--- a/drivers/nvdimm/region_devs.c
+++ b/drivers/nvdimm/region_devs.c
@@ -1168,6 +1168,9 @@ EXPORT_SYMBOL_GPL(nvdimm_has_cache);
 
 bool is_nvdimm_sync(struct nd_region *nd_region)
 {
+	if (is_nd_volatile(&nd_region->dev))
+		return true;
+
 	return is_nd_pmem(&nd_region->dev) &&
 		!test_bit(ND_REGION_ASYNC, &nd_region->flags);
 }
-- 
2.21.0

_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

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

end of thread, other threads:[~2019-09-25  3:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-24 11:43 [PATCH] libnvdimm/region: Update is_nvdimm_sync check to handle volatile regions Aneesh Kumar K.V
2019-09-24 11:52 ` Pankaj Gupta
2019-09-24 16:57 ` Dan Williams
2019-09-24 17:12   ` Dan Williams
2019-09-25  3:54     ` Aneesh Kumar K.V

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