Skip to content

Commit 5fdf8e5

Browse files
davejiangdjbw
authored andcommitted
libnvdimm: re-enable deep flush for pmem devices via fsync()
Re-enable deep flush so that users always have a way to be sure that a write makes it all the way out to media. Writes from the PMEM driver always arrive at the NVDIMM since movnt is used to bypass the cache, and the driver relies on the ADR (Asynchronous DRAM Refresh) mechanism to flush write buffers on power failure. The Deep Flush mechanism is there to explicitly write buffers to protect against (rare) ADR failure. This change prevents a regression in deep flush behavior so that applications can continue to depend on fsync() as a mechanism to trigger deep flush in the filesystem-DAX case. Fixes: 06e8ccd ("acpi: nfit: Add support for detect platform CPU cache...") Reviewed-by: Jeff Moyer <[email protected]> Signed-off-by: Dave Jiang <[email protected]> Signed-off-by: Dan Williams <[email protected]>
1 parent 94db151 commit 5fdf8e5

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/nvdimm/pmem.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,8 +335,7 @@ static int pmem_attach_disk(struct device *dev,
335335
dev_warn(dev, "unable to guarantee persistence of writes\n");
336336
fua = 0;
337337
}
338-
wbc = nvdimm_has_cache(nd_region) &&
339-
!test_bit(ND_REGION_PERSIST_CACHE, &nd_region->flags);
338+
wbc = nvdimm_has_cache(nd_region);
340339

341340
if (!devm_request_mem_region(dev, res->start, resource_size(res),
342341
dev_name(&ndns->dev))) {

0 commit comments

Comments
 (0)