Following both the enabling to retrieve a platform provided list of nvdimm media errors [1], and the new mcsafe_copy() enabling to recover from media read errors [2], implement error handling in the pmem i/o paths. This adds the following capabilities: 1/ Consult badblocks in the pmem_make_request() path to fail block layer requests to platform advertised bad address ranges. 2/ Use mcsafe_copy(), on capable platforms, to handle dynamically discovered media errors. 3/ Consult badblocks in the nvdimm_read_bytes() path to communicate errors for namespace metadata reads and btt data reads. [1]: https://lists.01.org/pipermail/linux-nvdimm/2015-December/003706.html [2]: https://lists.01.org/pipermail/linux-nvdimm/2016-January/003819.html --- Dan Williams (9): libnvdimm, pmem: move definition of nvdimm_namespace_add_poison to nd.h block: clarify badblocks lifetime pmem: fail io-requests to known bad blocks block, dax: disable dax in the presence of bad blocks x86, pmem: use __mcsafe_copy() for memcpy_from_pmem() libnvdimm, pmem: prepare for handling badblocks via nvdimm_read_bytes() block, badblocks, pmem: introduce devm_alloc_badblocks libnvdimm, pmem: nvdimm_read_bytes() badblocks support block: kill disk_{check|set|clear|alloc}_badblocks arch/x86/include/asm/pmem.h | 16 ++++++++ block/badblocks.c | 66 ++++++++++++++++++++++++++++----- block/genhd.c | 47 ------------------------ block/ioctl.c | 9 +++++ drivers/nvdimm/Kconfig | 1 + drivers/nvdimm/btt.c | 11 ++++++ drivers/nvdimm/btt_devs.c | 10 +++++ drivers/nvdimm/core.c | 71 ++++++++++++++++++++++-------------- drivers/nvdimm/nd-core.h | 2 - drivers/nvdimm/nd.h | 2 + drivers/nvdimm/pfn_devs.c | 10 +++++ drivers/nvdimm/pmem.c | 83 ++++++++++++++++++++++++++++++------------ drivers/nvdimm/region_devs.c | 6 +++ include/linux/badblocks.h | 3 ++ include/linux/genhd.h | 5 --- include/linux/nd.h | 2 + include/linux/pmem.h | 17 +++++++-- 17 files changed, 241 insertions(+), 120 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-block" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html