Skip to content

RFC realize dax_operations for dm-snapshot

Huaisheng Ye dm-devel linux-fsdevel linux-nvdimm lkml nvdimm 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 RFC Latest3 patches 2 repliesIn review
  2. v1 RFC3 patches 0 repliesSuperseded

Changes in v2 from the cover letter

Add NULL funtions for origin_dax_direct_access and origin_dax_copy_from/to_iter in order to avoid building error when CONFIG_DAX_DRIVER has NOT been enabled.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3dm: enable dax_operations for dm-snapshotdrivers/md/dm-snap.c+49 -20 replies
2/3dm: expand hc_map in mapped_device for lack of mapdrivers/md/dm-core.h drivers/md/dm-ioctl.c drivers/md/dm.c+17 -00 replies
3/3dm: expand valid types for dm-ioctldrivers/md/dm-ioctl.c+2 -10 replies

Reviews trailers per patch

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

Read the v2 thread

Cover letter [RFC PATCH v2 0/3] realize dax_operations for dm-snapshot

From: Huaisheng Ye <[email protected]>

Changes
v1->v2:
Add NULL funtions for origin_dax_direct_access and origin_dax_copy_from/to_iter in order to avoid building error when CONFIG_DAX_DRIVER has NOT been enabled.

[v1]: https://lkml.org/lkml/2018/11/20/759

This series patches are used to realize the dax_operations for dm-snapshot with persistent memory device.

Here are the steps about how to verify the function.

1. Configure the persistent memory to fs-dax mode and create namespace with ndctl;
2. find them in /dev;

  # ndctl list
  {
    "dev":"namespace0.0",
    "mode":"fsdax",
    "map":"dev",
    "size":132118478848,
    "sector_size":512,
    "blockdev":"pmem0",
    "name":"yhs_pmem0",
    "numa_node":0
  },
3. create lv_pmem (here is 4G size) for testing;
   # pvcreate /dev/pmem0
   # vgcreate vg_pmem /dev/pmem0
   # lvcreate  -L 4G -n lv_pmem vg_pmem
4. create filesystem (ext2 or ext4) to /dev/pmem0
   # mkfs.ext2 -b 4096 /dev/vg_pmem/lv_pmem
5. mount pmem with DAX way;
   # mkdir /mnt/lv_pmem
   # mount -o dax /dev/vg_pmem/lv_pmem /mnt/lv_pmem/
6. cp some files to /mnt/lv_pmem;
   # cp linear_table03.log /mnt/lv_pmem/
   # cp test0.log /mnt/lv_pmem/
7. create snapshot for test (here I limit it to 1G size);
   # lvcreate -L 1G -n snap_pmem -s /dev/vg_pmem/lv_pmem
8. modify the files copied with vim or copy more other new files;
   # vim /mnt/lv_pmem/test0.log
9. umount the pmem device;
   # umount /mnt/lv_pmem/
10.merge the snapshot back to origin;
   # lvconvert --merge /dev/vg_pmem/snap_pmem
11.mount pmem device again for checking the content of files;
   # mount -o dax /dev/vg_pmem/lv_pmem /mnt/lv_pmem/

Huaisheng Ye (3):
dm: enable dax_operations for dm-snapshot
dm: expand hc_map in mapped_device for lack of map
dm: expand valid types for dm-ioctl

 drivers/md/dm-core.h  |  1 +
 drivers/md/dm-ioctl.c |  4 +++-
 drivers/md/dm-snap.c  | 51 +++++++++++++++++++++++++++++++++++++++++++++++++--
 drivers/md/dm.c       | 15 +++++++++++++++
 4 files changed, 68 insertions(+), 3 deletions(-)
Signature · 1 line
1.8.3.1