pmem: implement pmem_recovery_write()
authorJane Chu <jane.chu@oracle.com>
Fri, 13 May 2022 22:13:20 +0000 (15:13 -0700)
committerDan Williams <dan.j.williams@intel.com>
Mon, 16 May 2022 20:38:19 +0000 (13:38 -0700)
commitf42e8e5088b9e791c8f7ac661f68e29a4996a4e3
treee335ac2703aa90988d00b5f5a56f335e4e77e70b
parent9409c9b6709e59866ed3540b5d7f5291439e4833
pmem: implement pmem_recovery_write()

The recovery write thread started out as a normal pwrite thread and
when the filesystem was told about potential media error in the
range, filesystem turns the normal pwrite to a dax_recovery_write.

The recovery write consists of clearing media poison, clearing page
HWPoison bit, reenable page-wide read-write permission, flush the
caches and finally write.  A competing pread thread will be held
off during the recovery process since data read back might not be
valid, and this is achieved by clearing the badblock records after
the recovery write is complete. Competing recovery write threads
are already serialized by writer lock held by dax_iomap_rw().

Signed-off-by: Jane Chu <jane.chu@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/165247997655.53156.8381418704988035976.stgit@dwillia2-desk3.amr.corp.intel.com
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/nvdimm/pmem.c