[PATCH 4.2 059/258] pmem: add proper fencing to pmem_rw_page()

From: Greg Kroah-Hartman
Date: Sun Oct 18 2015 - 00:42:48 EST


4.2-stable review patch. If anyone has any objections, please let me know.

------------------

From: Ross Zwisler <ross.zwisler@xxxxxxxxxxxxxxx>

commit ba8fe0f85e15d047686caf8a42463b592c63c98c upstream.

pmem_rw_page() needs to call wmb_pmem() on writes to make sure that the
newly written data is durable. This flow was added to pmem_rw_bytes()
and pmem_make_request() with this commit:

commit 61031952f4c8 ("arch, x86: pmem api for ensuring durability of
persistent memory updates")

...the pmem_rw_page() path was missed.

Signed-off-by: Ross Zwisler <ross.zwisler@xxxxxxxxxxxxxxx>
Signed-off-by: Dan Williams <dan.j.williams@xxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

---
drivers/nvdimm/pmem.c | 2 ++
1 file changed, 2 insertions(+)

--- a/drivers/nvdimm/pmem.c
+++ b/drivers/nvdimm/pmem.c
@@ -86,6 +86,8 @@ static int pmem_rw_page(struct block_dev
struct pmem_device *pmem = bdev->bd_disk->private_data;

pmem_do_bvec(pmem, page, PAGE_CACHE_SIZE, 0, rw, sector);
+ if (rw & WRITE)
+ wmb_pmem();
page_endio(page, rw & WRITE, 0);

return 0;


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/