Skip to content

dax poison recovery with RWF_RECOVERY_DATA flag

Jane Chu dm-devel linux-btrfs linux-fsdevel linux-xfs lkml llvm nvdimm oe-kbuild-all 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 55 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6dax: introduce RWF_RECOVERY_DATA flag to preadv2() and pwritev2()fs/dax.c include/linux/fs.h include/linux/iomap.h +1 more+9 -10 replies
2/6dax: prepare dax_direct_access() API with DAXDEV_F_RECOVERY flagdrivers/dax/super.c drivers/md/dm-linear.c drivers/md/dm-log-writes.c +13 more+44 -332 replies
3/6pmem: pmem_dax_direct_access() to honor the DAXDEV_F_RECOVERY flagdrivers/nvdimm/pmem.c+3 -22 replies
4/6dm,dax,pmem: prepare dax_copy_to/from_iter() APIs with DAXDEV_F_RECOVERYdrivers/dax/super.c drivers/md/dm-linear.c drivers/md/dm-log-writes.c +8 more+41 -375 replies
5/6dax,pmem: Add data recovery feature to pmem_copy_to/from_iter()drivers/nvdimm/pmem.c fs/dax.c+72 -52 replies
6/6dm: Ensure dm honors DAXDEV_F_RECOVERY flag on dax onlydrivers/md/dm.c+4 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/6] dax poison recovery with RWF_RECOVERY_DATA flag

This patch set is a follow up to below conversation
https://lore.kernel.org/linux-xfs/[email protected]/
where Dave Chinner proposed a single flag RWF_RECOVER_DATA to be added to the system calls preadv2() and pwritev2() for the purpose of user directed recovery from data loss due to poison in a dax range.

The idea is that when a dax range is poisoned, this flag gives preadv2() permission to fetch as much clean data as possible, and permission for pwritev2() to attempt to clear poison(s) in the range and then store the good data over.

This feature maybe deployed by user process' signal handler in response to SIGBUS with BUS_MCEERR_AR or BUS_ADRERR when the 'si_addr' points to a dax range; or, simply when not sure of a poison free range. This approach does not fragment the dax backend, if it is unable to clear poison, it will fail the pwritev2() so that the situation is explicit to the user. This approach is not recommended to normal non-recovery code path due to potential performance impact incurred by poison checking.

Also, this approach is an alternative to the existing punch-a-hole-followed-by-pwrite approach which does not clear poison, but instead, allocates a discontiguous clean backend range to satisfy the pwrite().

Jane Chu (6):
dax: introduce RWF_RECOVERY_DATA flag to preadv2() and pwritev2()
dax: prepare dax_direct_access() API with DAXDEV_F_RECOVERY flag
pmem: pmem_dax_direct_access() to honor the DAXDEV_F_RECOVERY flag dm,dax,pmem: prepare dax_copy_to/from_iter() APIs with
DAXDEV_F_RECOVERY
dax,pmem: Add data recovery feature to pmem_copy_to/from_iter()
dm: Ensure dm honors DAXDEV_F_RECOVERY flag on dax only

 drivers/dax/super.c             | 19 ++++---
 drivers/md/dm-linear.c          | 12 ++---
 drivers/md/dm-log-writes.c      | 17 ++++---
 drivers/md/dm-stripe.c          | 12 ++---
 drivers/md/dm-target.c          |  2 +-
 drivers/md/dm-writecache.c      |  4 +-
 drivers/md/dm.c                 | 16 +++---
 drivers/nvdimm/pmem.c           | 88 ++++++++++++++++++++++++++++-----
 drivers/nvdimm/pmem.h           |  2 +-
 drivers/s390/block/dcssblk.c    | 13 +++--
 fs/dax.c                        | 24 ++++++---
 fs/fuse/dax.c                   |  2 +-
 fs/fuse/virtio_fs.c             | 12 ++---
 include/linux/dax.h             | 15 +++---
 include/linux/device-mapper.h   |  4 +-
 include/linux/fs.h              |  1 +
 include/linux/iomap.h           |  1 +
 include/uapi/linux/fs.h         |  5 +-
 tools/testing/nvdimm/pmem-dax.c |  2 +-
 19 files changed, 173 insertions(+), 78 deletions(-)
Signature · 1 line
2.18.4