Introduce xfs_mmaplock_two_inodes_and_break_dax_layout() for dax files
who are going to be deduped. After that, call compare range function
only when files are both DAX or not.
Signed-off-by: Shiyang Ruan
---
fs/xfs/xfs_file.c| 2 +-
fs/xfs/xfs_inode.c | 57
In fsdax mode, WRITE and ZERO on a shared extent need CoW performed. After
CoW, new allocated extents needs to be remapped to the file. So, add an
iomap_end for dax write ops to do the remapping work.
Signed-off-by: Shiyang Ruan
---
fs/xfs/xfs_bmap_util.c | 3 +--
fs/xfs/xfs_file.c | 9
Some operations, such as comparing a range of data in two files under
fsdax mode, requires nested iomap_open()/iomap_end() on two file. Thus,
we introduce iomap_apply2() to accept arguments from two files and
iomap_actor2_t for actions on two files.
Signed-off-by: Shiyang Ruan
Reviewed-by
With dax we cannot deal with readpage() etc. So, we create a dax
comparison funciton which is similar with
vfs_dedupe_file_range_compare().
And introduce dax_remap_file_range_prep() for filesystem use.
Signed-off-by: Goldwyn Rodrigues
Signed-off-by: Shiyang Ruan
---
fs/dax.c | 66
Punch hole on a reflinked file needs dax_copy_edge() too. Otherwise,
data in not aligned area will be not correct. So, add the srcmap to
dax_iomap_zero() and replace memset() as dax_copy_edge().
Signed-off-by: Shiyang Ruan
Reviewed-by: Ritesh Harjani
---
fs/dax.c | 25
-by: Shiyang Ruan
Reviewed-by: Christoph Hellwig
Reviewed-by: Ritesh Harjani
Reviewed-by: Darrick J. Wong
---
fs/dax.c | 39 ---
1 file changed, 28 insertions(+), 11 deletions(-)
diff --git a/fs/dax.c b/fs/dax.c
index 6396f091e60b..98531c53d613 100644
--- a/fs
to copy the head and tail ranges which is
outside of the non-aligned area instead of copying the whole aligned
range. But in dax page fault, it will always be an aligned range. So,
we have to copy the whole range in this case.
Signed-off-by: Shiyang Ruan
Reviewed-by: Christoph Hellwig
Reviewed
me
changes to adapt to this patchset.
(Rebased on v5.13-rc2 and patchset[1])
[1]: https://lkml.org/lkml/2021/4/22/575
Shiyang Ruan (7):
fsdax: Introduce dax_iomap_cow_copy()
fsdax: Replace mmap entry in case of CoW
fsdax: Add dax_iomap_cow_copy() for dax_iomap_zero
iomap: Introduce io
Introduce xfs_mmaplock_two_inodes_and_break_dax_layout() for dax files
who are going to be deduped. After that, call compare range function
only when files are both DAX or not.
Signed-off-by: Shiyang Ruan
---
fs/xfs/xfs_file.c| 2 +-
fs/xfs/xfs_inode.c | 66
In fsdax mode, WRITE and ZERO on a shared extent need CoW performed. After
CoW, new allocated extents needs to be remapped to the file. So, add an
iomap_end for dax write ops to do the remapping work.
Signed-off-by: Shiyang Ruan
---
fs/xfs/xfs_bmap_util.c | 3 +--
fs/xfs/xfs_file.c | 9
With dax we cannot deal with readpage() etc. So, we create a dax
comparison funciton which is similar with
vfs_dedupe_file_range_compare().
And introduce dax_remap_file_range_prep() for filesystem use.
Signed-off-by: Goldwyn Rodrigues
Signed-off-by: Shiyang Ruan
---
fs/dax.c | 56
Some operations, such as comparing a range of data in two files under
fsdax mode, requires nested iomap_open()/iomap_end() on two file. Thus,
we introduce iomap_apply2() to accept arguments from two files and
iomap_actor2_t for actions on two files.
Signed-off-by: Shiyang Ruan
Reviewed-by
Punch hole on a reflinked file needs dax_copy_edge() too. Otherwise,
data in not aligned area will be not correct. So, add the srcmap to
dax_iomap_zero() and replace memset() as dax_copy_edge().
Signed-off-by: Shiyang Ruan
Reviewed-by: Ritesh Harjani
---
fs/dax.c | 25
-by: Shiyang Ruan
Reviewed-by: Christoph Hellwig
Reviewed-by: Ritesh Harjani
---
fs/dax.c | 39 ---
1 file changed, 28 insertions(+), 11 deletions(-)
diff --git a/fs/dax.c b/fs/dax.c
index f0249bb1d46a..ef0e564e7904 100644
--- a/fs/dax.c
+++ b/fs/dax.c
to copy the head and tail ranges which is
outside of the non-aligned area instead of copying the whole aligned
range. But in dax page fault, it will always be an aligned range. So,
we have to copy the whole range in this case.
Signed-off-by: Shiyang Ruan
Reviewed-by: Christoph Hellwig
---
fs
changes to adapt to this patchset.
(Rebased on v5.13-rc1 and patchset[1])
[1]: https://lkml.org/lkml/2021/4/22/575
Shiyang Ruan (7):
fsdax: Introduce dax_iomap_cow_copy()
fsdax: Replace mmap entry in case of CoW
fsdax: Add dax_iomap_cow_copy() for dax_iomap_zero
iomap: Introduce iomap_ap
Add address output in dax_iomap_pfn() in order to perform a memcpy() in
CoW case. Since this function both output address and pfn, rename it to
dax_iomap_direct_access().
Signed-off-by: Shiyang Ruan
Reviewed-by: Christoph Hellwig
Reviewed-by: Ritesh Harjani
---
fs/dax.c | 16
The dax page fault code is too long and a bit difficult to read. And it
is hard to understand when we trying to add new features. Some of the
PTE/PMD codes have similar logic. So, factor them as helper functions to
simplify the code.
Signed-off-by: Shiyang Ruan
Reviewed-by: Christoph Hellwig
The core logic in the two dax page fault functions is similar. So, move
the logic into a common helper function. Also, to facilitate the
addition of new features, such as CoW, switch-case is no longer used to
handle different iomap types.
Signed-off-by: Shiyang Ruan
Reviewed-by: Christoph
From: Shiyang Ruan
The page fault part of fsdax code is little complex. In order to add CoW
feature and make it easy to understand, I was suggested to factor some
helper functions to simplify the current dax code.
This is separated from the previous patchset called "V3 fsdax,xfs: Add
re
Add xfs_break_two_dax_layouts() to break layout for tow dax files. Then
call compare range function only when files are both DAX or not.
Signed-off-by: Shiyang Ruan
---
fs/xfs/xfs_file.c| 20
fs/xfs/xfs_inode.c | 8 +++-
fs/xfs/xfs_inode.h | 1 +
fs/xfs
In fsdax mode, WRITE and ZERO on a shared extent need CoW performed. After
CoW, new allocated extents needs to be remapped to the file. So, add an
iomap_end for dax write ops to do the remapping work.
Signed-off-by: Shiyang Ruan
---
fs/xfs/xfs_bmap_util.c | 3 +--
fs/xfs/xfs_file.c | 9
With dax we cannot deal with readpage() etc. So, we create a dax
comparison funciton which is similar with
vfs_dedupe_file_range_compare().
And introduce dax_remap_file_range_prep() for filesystem use.
Signed-off-by: Goldwyn Rodrigues
Signed-off-by: Shiyang Ruan
---
fs/dax.c | 56
Some operations, such as comparing a range of data in two files under
fsdax mode, requires nested iomap_open()/iomap_end() on two file. Thus,
we introduce iomap_apply2() to accept arguments from two files and
iomap_actor2_t for actions on two files.
Signed-off-by: Shiyang Ruan
---
fs/iomap
Punch hole on a reflinked file needs dax_copy_edge() too. Otherwise,
data in not aligned area will be not correct. So, add the srcmap to
dax_iomap_zero() and replace memset() as dax_copy_edge().
Signed-off-by: Shiyang Ruan
Reviewed-by: Ritesh Harjani
---
fs/dax.c | 25
-by: Shiyang Ruan
Reviewed-by: Christoph Hellwig
Reviewed-by: Ritesh Harjani
---
fs/dax.c | 39 ---
1 file changed, 28 insertions(+), 11 deletions(-)
diff --git a/fs/dax.c b/fs/dax.c
index b4fd3813457a..e6c1354b27a8 100644
--- a/fs/dax.c
+++ b/fs/dax.c
to copy the head and tail ranges which is
outside of the non-aligned area instead of copying the whole aligned
range. But in dax page fault, it will always be an aligned range. So,
we have to copy the whole range in this case.
Signed-off-by: Shiyang Ruan
Reviewed-by: Christoph Hellwig
---
fs
/linux-xfs/20210407133823.828176-1-ruansy.f...@fujitsu.com/
==
Shiyang Ruan (7):
fsdax: Introduce dax_iomap_cow_copy()
fsdax: Replace mmap entry in case of CoW
fsdax: Add dax_iomap_cow_copy() for dax_iomap_zero
iomap: Introduce iomap_apply2() for operations on two files
fsdax: Dedup file rang
Add address output in dax_iomap_pfn() in order to perform a memcpy() in
CoW case. Since this function both output address and pfn, rename it to
dax_iomap_direct_access().
Signed-off-by: Shiyang Ruan
Reviewed-by: Christoph Hellwig
Reviewed-by: Ritesh Harjani
---
fs/dax.c | 16
The core logic in the two dax page fault functions is similar. So, move
the logic into a common helper function. Also, to facilitate the
addition of new features, such as CoW, switch-case is no longer used to
handle different iomap types.
Signed-off-by: Shiyang Ruan
Reviewed-by: Christoph
pport for fsdax", and the previous comments are here[1].
[1]:
https://patchwork.kernel.org/project/linux-nvdimm/patch/20210319015237.993880-3-ruansy.f...@fujitsu.com/
Changes from V1:
- fix Ritesh's email address
- simplify return logic in dax_fault_cow_page()
(Rebased on v5.12-rc5)
The dax page fault code is too long and a bit difficult to read. And it
is hard to understand when we trying to add new features. Some of the
PTE/PMD codes have similar logic. So, factor them as helper functions to
simplify the code.
Signed-off-by: Shiyang Ruan
Reviewed-by: Christoph Hellwig
Add address output in dax_iomap_pfn() in order to perform a memcpy() in
CoW case. Since this function both output address and pfn, rename it to
dax_iomap_direct_access().
Signed-off-by: Shiyang Ruan
Reviewed-by: Christoph Hellwig
Reviewed-by: Ritesh Harjani
---
fs/dax.c | 16
The core logic in the two dax page fault functions is similar. So, move
the logic into a common helper function. Also, to facilitate the
addition of new features, such as CoW, switch-case is no longer used to
handle different iomap types.
Signed-off-by: Shiyang Ruan
Reviewed-by: Christoph
The dax page fault code is too long and a bit difficult to read. And it
is hard to understand when we trying to add new features. Some of the
PTE/PMD codes have similar logic. So, factor them as helper functions to
simplify the code.
Signed-off-by: Shiyang Ruan
Reviewed-by: Christoph Hellwig
The page fault part of fsdax code is little complex. In order to add CoW
feature and make it easy to understand, I was suggested to factor some
helper functions to simplify the current dax code.
(Rebased on v5.12-rc5)
==
Shiyang Ruan (3):
fsdax: Factor helpers to simplify dax fault code
Add xfs_break_two_dax_layouts() to break layout for tow dax files. Then
call compare range function only when files are both DAX or not.
Signed-off-by: Shiyang Ruan
---
fs/xfs/xfs_file.c| 20
fs/xfs/xfs_inode.c | 8 +++-
fs/xfs/xfs_inode.h | 1 +
fs/xfs
In fsdax mode, WRITE and ZERO on a shared extent need CoW performed. After
CoW, new allocated extents needs to be remapped to the file. So, add an
iomap_end for dax write ops to do the remapping work.
Signed-off-by: Shiyang Ruan
---
fs/xfs/xfs_bmap_util.c | 3 +--
fs/xfs/xfs_file.c | 9
With dax we cannot deal with readpage() etc. So, we create a dax
comparison funciton which is similar with
vfs_dedupe_file_range_compare().
And introduce dax_remap_file_range_prep() for filesystem use.
Signed-off-by: Goldwyn Rodrigues
Signed-off-by: Shiyang Ruan
---
fs/dax.c | 56
Some operations, such as comparing a range of data in two files under
fsdax mode, requires nested iomap_open()/iomap_end() on two file. Thus,
we introduce iomap_apply2() to accept arguments from two files and
iomap_actor2_t for actions on two files.
Signed-off-by: Shiyang Ruan
---
fs/iomap
-by: Shiyang Ruan
Reviewed-by: Christoph Hellwig
---
fs/dax.c | 37 ++---
1 file changed, 26 insertions(+), 11 deletions(-)
diff --git a/fs/dax.c b/fs/dax.c
index 181aad97136a..cfe513eb111e 100644
--- a/fs/dax.c
+++ b/fs/dax.c
@@ -722,6 +722,9 @@ static int
Punch hole on a reflinked file needs dax_copy_edge() too. Otherwise,
data in not aligned area will be not correct. So, add the srcmap to
dax_iomap_zero() and replace memset() as dax_copy_edge().
Signed-off-by: Shiyang Ruan
---
fs/dax.c | 9 +++--
fs/iomap/buffered-io.c | 2
to copy the head and tail ranges which is
outside of the non-aligned area instead of copying the whole aligned
range. But in dax page fault, it will always be an aligned range. So,
we have to copy the whole range in this case.
Signed-off-by: Shiyang Ruan
Reviewed-by: Christoph Hellwig
---
fs
Add address output in dax_iomap_pfn() in order to perform a memcpy() in
CoW case. Since this function both output address and pfn, rename it to
dax_iomap_direct_access().
Signed-off-by: Shiyang Ruan
Reviewed-by: Christoph Hellwig
---
fs/dax.c | 16
1 file changed, 12
The core logic in the two dax page fault functions is similar. So, move
the logic into a common helper function. Also, to facilitate the
addition of new features, such as CoW, switch-case is no longer used to
handle different iomap types.
Signed-off-by: Shiyang Ruan
---
fs/dax.c | 291
From: Shiyang Ruan
This patchset is attempt to add CoW support for fsdax, and take XFS,
which has both reflink and fsdax feature, as an example.
Changes from V2:
- Fix the mistake in iomap_apply2() and dax_dedupe_file_range_compare()
- Add CoW judgement in dax_iomap_zero()
- Fix other code
The dax page fault code is too long and a bit difficult to read. And it
is hard to understand when we trying to add new features. Some of the
PTE/PMD codes have similar logic. So, factor them as helper functions to
simplify the code.
Signed-off-by: Shiyang Ruan
Reviewed-by: Christoph Hellwig
With dax we cannot deal with readpage() etc. So, we create a dax
comparison funciton which is similar with
vfs_dedupe_file_range_compare().
And introduce dax_remap_file_range_prep() for filesystem use.
Signed-off-by: Goldwyn Rodrigues
Signed-off-by: Shiyang Ruan
---
fs/dax.c | 56
Some operations, such as comparing a range of data in two files under
fsdax mode, requires nested iomap_open()/iomap_end() on two file. Thus,
we introduce iomap_apply2() to accept arguments from two files and
iomap_actor2_t for actions on two files.
Signed-off-by: Shiyang Ruan
---
fs/iomap
With dax we cannot deal with readpage() etc. So, we create a dax
comparison funciton which is similar with
vfs_dedupe_file_range_compare().
And introduce dax_remap_file_range_prep() for filesystem use.
Signed-off-by: Goldwyn Rodrigues
Signed-off-by: Shiyang Ruan
---
fs/dax.c | 56
Some operations, such as comparing a range of data in two files under
fsdax mode, requires nested iomap_open()/iomap_end() on two file. Thus,
we introduce iomap_apply2() to accept arguments from two files and
iomap_actor2_t for actions on two files.
Signed-off-by: Shiyang Ruan
---
fs/iomap
In fsdax mode, WRITE and ZERO on a shared extent need CoW performed. After
CoW, new allocated extents needs to be remapped to the file. So, add an
iomap_end for dax write ops to do the remapping work.
Signed-off-by: Shiyang Ruan
---
fs/xfs/xfs_bmap_util.c | 3 ++-
fs/xfs/xfs_file.c | 9
Add xfs_break_two_dax_layouts() to break layout for tow dax files. Then
call compare range function only when files are both DAX or not.
Signed-off-by: Shiyang Ruan
---
fs/xfs/xfs_file.c| 20
fs/xfs/xfs_inode.c | 8 +++-
fs/xfs/xfs_inode.h | 1 +
fs/xfs
With dax we cannot deal with readpage() etc. So, we create a dax
comparison funciton which is similar with
vfs_dedupe_file_range_compare().
And introduce dax_remap_file_range_prep() for filesystem use.
Signed-off-by: Goldwyn Rodrigues
Signed-off-by: Shiyang Ruan
---
fs/dax.c | 51
Some operations, such as comparing a range of data in two files under
fsdax mode, requires nested iomap_open()/iomap_end() on two file. Thus,
we introduce iomap_apply2() to accept arguments from two files and
iomap_actor2_t for actions on two files.
Signed-off-by: Shiyang Ruan
---
fs/iomap
Punch hole on a reflinked file needs dax_copy_edge() too. Otherwise,
data in not aligned area will be not correct. So, add the srcmap to
dax_iomap_zero() and replace memset() as dax_copy_edge().
Signed-off-by: Shiyang Ruan
---
fs/dax.c | 6 --
fs/iomap/buffered-io.c | 2
-by: Shiyang Ruan
---
fs/dax.c | 37 ++---
1 file changed, 26 insertions(+), 11 deletions(-)
diff --git a/fs/dax.c b/fs/dax.c
index 748dfb89fb41..ec4b733e0b59 100644
--- a/fs/dax.c
+++ b/fs/dax.c
@@ -722,6 +722,9 @@ static int copy_cow_page_dax(struct block_device
to copy the head and tail ranges which is
outside of the non-aligned area instead of copying the whole aligned
range. But in dax page fault, it will always be an aligned range. So,
we have to copy the whole range in this case.
Signed-off-by: Shiyang Ruan
---
fs/dax.c | 73
Add address output in dax_iomap_pfn() in order to perform a memcpy() in
CoW case. Since this function both output address and pfn, rename it to
dax_iomap_direct_access().
Signed-off-by: Shiyang Ruan
Reviewed-by: Christoph Hellwig
---
fs/dax.c | 16
1 file changed, 12
The core logic in the two dax page fault functions is similar. So, move
the logic into a common helper function. Also, to facilitate the
addition of new features, such as CoW, switch-case is no longer used to
handle different iomap types.
Signed-off-by: Shiyang Ruan
---
fs/dax.c | 211
The dax page fault code is too long and a bit difficult to read. And it
is hard to understand when we trying to add new features. Some of the
PTE/PMD codes have similar logic. So, factor them as helper functions to
simplify the code.
Signed-off-by: Shiyang Ruan
---
fs/dax.c | 152
me of the patches are picked up from Goldwyn's patchset. I made some
changes to adapt to this patchset.
(Rebased on v5.11)
==
Shiyang Ruan (10):
fsdax: Factor helpers to simplify dax fault code
fsdax: Factor helper: dax_fault_actor()
fsdax: Output address in dax_iomap_pfn() and rename
mapped into their address spaces, but
future patches could actually do something about corrupt metadata.
After that, the memory failure needs to notify the processes who are
using those files.
Only support data device. Realtime device is not supported for now.
Signed-off-by: Shiyang Ruan
---
fs
With the support of ->rmap(), it is possible to obtain the superblock on
a mapped device.
Signed-off-by: Shiyang Ruan
---
drivers/md/dm.c | 61 +
1 file changed, 61 insertions(+)
diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index 7bac564f3
future. However,
some targets may not support it because of the non-linear mapping.
Signed-off-by: Shiyang Ruan
---
drivers/md/dm-linear.c| 20
include/linux/device-mapper.h | 5 +
2 files changed, 25 insertions(+)
diff --git a/drivers/md/dm-linear.c b/drivers/md
Since owner tarcking is triggerred by pmem device, these functions are
useless. So remove them.
Signed-off-by: Shiyang Ruan
---
fs/dax.c | 46 --
1 file changed, 46 deletions(-)
diff --git a/fs/dax.c b/fs/dax.c
index c64c3a0e76a6..e20a5df03eec
Obtain the superblock of a pmem disk, and call filesystem's
->corrupted_range() to handle the corrupted data.
Signed-off-by: Shiyang Ruan
---
block/genhd.c | 6 ++
drivers/nvdimm/pmem.c | 19 +++
include/linux/genhd.h | 1 +
3 files changed, 26 insertions(
to roll back if driver/device/filesystem
does not support ->memory_failure()/->corrupted_range().
Signed-off-by: Shiyang Ruan
---
drivers/nvdimm/pmem.c | 26 +++
mm/memory-failure.c | 102 +-
2 files changed, 87 insertions(+), 41 deletions
file and offset.
Signed-off-by: Shiyang Ruan
---
fs/dax.c| 21 ++
include/linux/dax.h | 1 +
include/linux/mm.h | 9 +
mm/memory-failure.c | 98 ++---
4 files changed, 105 insertions(+), 24 deletions(-)
diff --git a/fs/dax.c b/fs/d
lock device
to find out the MD that contains it. By this way, MD is able to call
corrupted_range() from its target block device.
Signed-off-by: Shiyang Ruan
---
fs/block_dev.c| 47 ++-
include/linux/genhd.h | 2 ++
2 files changed, 48 insertions(
Memory failure occurs in fsdax mode will finally be handled in
filesystem. We introduce this interface to find out files or metadata
affected by the corrupted range, and try to recover the corrupted data
if possiable.
Signed-off-by: Shiyang Ruan
---
include/linux/fs.h | 2 ++
1 file changed, 2
In fsdax mode, the memory failure happens on block device. So, it is
needed to introduce an interface for block devices. Each kind of block
device can handle the memory failure in ther own ways.
Signed-off-by: Shiyang Ruan
---
include/linux/blkdev.h | 2 ++
1 file changed, 2 insertions
shutdown()
* corrupted on file data
try to recover data, call mf_dax_mapping_kill_procs()
The fsdax & reflink support for XFS is not contained in this patchset.
(Rebased on v5.11-rc5)
==
Shiyang Ruan (11):
pagemap: Introduce ->memory_failure()
blk: Introduce ->
finally call filesystem handler to deal with the error.
The filesystem will try to recover the corrupted data if possiable.
Signed-off-by: Shiyang Ruan
---
include/linux/memremap.h | 8
1 file changed, 8 insertions(+)
diff --git a/include/linux/memremap.h b/include/linux/memremap.h
index
Add xfs_break_two_dax_layouts() to break layout for tow dax files. Then
call compare range function only when files are both DAX or not.
Signed-off-by: Shiyang Ruan
---
fs/xfs/xfs_file.c| 20
fs/xfs/xfs_inode.c | 8 +++-
fs/xfs/xfs_inode.h | 1 +
fs/xfs
With dax we cannot deal with readpage() etc. So, we create a
funciton callback to perform the file data comparison and pass
it to generic_remap_file_range_prep() so it can use iomap-based
functions.
Signed-off-by: Goldwyn Rodrigues
Signed-off-by: Shiyang Ruan
---
fs/btrfs/reflink.c | 3
dax_copy_edges() is a helper functions performs a copy from one part of
the device to another for data not page aligned.
Signed-off-by: Goldwyn Rodrigues
Signed-off-by: Shiyang Ruan
---
fs/dax.c | 41 +
1 file changed, 41 insertions(+)
diff --git a/fs
: Shiyang Ruan
---
fs/dax.c | 31 +++
1 file changed, 23 insertions(+), 8 deletions(-)
diff --git a/fs/dax.c b/fs/dax.c
index b2195cbdf2dc..29698a3d2e37 100644
--- a/fs/dax.c
+++ b/fs/dax.c
@@ -722,6 +722,9 @@ static int copy_cow_page_dax(struct block_device *bdev
In fsdax mode, WRITE and ZERO on a shared extent need CoW mechanism
performed. After CoW, new extents needs to be remapped to the file.
Signed-off-by: Shiyang Ruan
---
fs/xfs/xfs_bmap_util.c | 6 +-
fs/xfs/xfs_file.c | 10 +++---
fs/xfs/xfs_iomap.c | 3 ++-
fs/xfs/xfs_iops.c
Add dax_copy_edges() into each dax actor functions to perform CoW.
Signed-off-by: Shiyang Ruan
---
fs/dax.c | 37 ++---
1 file changed, 34 insertions(+), 3 deletions(-)
diff --git a/fs/dax.c b/fs/dax.c
index ea4e8a434900..b2195cbdf2dc 100644
--- a/fs/dax.c
+++ b
e two mechanism implemented in fsdax, we are able to make reflink
and fsdax work together in XFS.
Some of the patches are picked up from Goldwyn's patchset. I made some
changes to adapt to this patchset.
(Rebased on v5.10)
==
Shiyang Ruan (7):
fsdax: Output address in dax_iomap_pfn() and
Add address output in dax_iomap_pfn() in order to perform a memcpy() in
CoW case. Since this function both output address and pfn, rename it to
dax_iomap_direct_access().
Signed-off-by: Shiyang Ruan
---
fs/dax.c | 20 +++-
1 file changed, 15 insertions(+), 5 deletions(-)
diff
dev->bd_holder_disks to obtain its mapped device.
Signed-off-by: Shiyang Ruan
---
drivers/md/dm.c | 61 +++
drivers/nvdimm/pmem.c | 11 +++-
fs/block_dev.c| 42 -
include/linux/genhd.h | 2 ++
4 files change
Since owner tarcking is triggerred by pmem device, these functions are
useless. So remove it.
Signed-off-by: Shiyang Ruan
---
fs/dax.c | 46 --
1 file changed, 46 deletions(-)
diff --git a/fs/dax.c b/fs/dax.c
index c64c3a0e76a6..e20a5df03eec 100644
future. However,
some targets may not support it because of the non-linear mapping.
Signed-off-by: Shiyang Ruan
---
drivers/md/dm-linear.c| 20
include/linux/device-mapper.h | 5 +
2 files changed, 25 insertions(+)
diff --git a/drivers/md/dm-linear.c b/drivers/md
repair the corrupted data.(did not
implemented in this patchset)
After that, the memory failure also needs to notify the processes who
are using those files.
Only support data device. Realtime device is not supported for now.
Signed-off-by: Shiyang Ruan
---
fs/xfs/xfs_fsops.c | 5 +
Obtain the superblock of a pmem disk, and call filesystem's
->corrupted_range() to handle the corrupted data.
Signed-off-by: Shiyang Ruan
---
block/genhd.c | 6 ++
drivers/nvdimm/pmem.c | 24
include/linux/genhd.h | 1 +
3 files changed, 31 in
file and offset.
Signed-off-by: Shiyang Ruan
---
fs/dax.c| 21 ++
include/linux/dax.h | 1 +
include/linux/mm.h | 9 +
mm/memory-failure.c | 98 ++---
4 files changed, 105 insertions(+), 24 deletions(-)
diff --git a/fs/dax.c b/fs/d
The fsdax & reflink support for XFS is not contained in this patchset.
(Rebased on v5.11-rc5)
Shiyang Ruan (10):
pagemap: Introduce ->memory_failure()
blk: Introduce ->corrupted_range() for block device
fs: Introduce ->corrupted_range() for superblock
mm, fsdax: Re
Memory failure occurs in fsdax mode will finally be handled in
filesystem. We introduce this interface to find out files or metadata
affected by the corrupted range, and try to recover the corrupted data
if possiable.
Signed-off-by: Shiyang Ruan
---
include/linux/fs.h | 2 ++
1 file changed, 2
to roll back if driver/device/filesystem
does not support ->memory_failure()/->corrupted_range().
Signed-off-by: Shiyang Ruan
---
drivers/nvdimm/pmem.c | 25 +++
mm/memory-failure.c | 102 +-
2 files changed, 86 insertions(+), 41 deletions
In fsdax mode, the memory failure happens on block device. So, it is
needed to introduce an interface for block devices. Each kind of block
device can handle the memory failure in ther own ways.
Signed-off-by: Shiyang Ruan
---
include/linux/blkdev.h | 2 ++
1 file changed, 2 insertions
finally call filesystem handler to deal with the error.
The filesystem will try to recover the corrupted data if possiable.
Signed-off-by: Shiyang Ruan
---
include/linux/memremap.h | 8
1 file changed, 8 insertions(+)
diff --git a/include/linux/memremap.h b/include/linux/memremap.h
index
The return value of range_parse() indicates the size when it is
positive. The error code should be negative.
Signed-off-by: Shiyang Ruan
---
drivers/dax/bus.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/dax/bus.c b/drivers/dax/bus.c
index 737b207c9e30
dev->bd_holder_disks to obtain its mapped device.
Signed-off-by: Shiyang Ruan
---
drivers/md/dm.c | 61 +++
drivers/nvdimm/pmem.c | 11 +++-
fs/block_dev.c| 42 -
include/linux/genhd.h | 2 ++
4 files change
repair the corrupted data.(did not
implemented in this patchset)
After that, the memory failure also needs to notify the processes who
are using those files.
Only support data device. Realtime device is not supported for now.
Signed-off-by: Shiyang Ruan
---
fs/xfs/xfs_fsops.c | 5 +
Since owner tarcking is triggerred by pmem device, these functions are
useless. So remove it.
Signed-off-by: Shiyang Ruan
---
fs/dax.c | 46 --
1 file changed, 46 deletions(-)
diff --git a/fs/dax.c b/fs/dax.c
index c64c3a0e76a6..e20a5df03eec 100644
to roll back if driver/device/filesystem
does not support ->memory_failure()/->corrupted_range().
Signed-off-by: Shiyang Ruan
---
drivers/nvdimm/pmem.c | 25 +++
mm/memory-failure.c | 102 +-
2 files changed, 86 insertions(+), 41 deletions
Memory failure occurs in fsdax mode will finally be handled in
filesystem. We introduce this interface to find out files or metadata
affected by the corrupted range, and try to recover the corrupted data
if possiable.
Signed-off-by: Shiyang Ruan
---
include/linux/fs.h | 2 ++
1 file changed, 2
file and offset.
Signed-off-by: Shiyang Ruan
---
fs/dax.c| 21 ++
include/linux/dax.h | 1 +
include/linux/mm.h | 9 +
mm/memory-failure.c | 98 ++---
4 files changed, 105 insertions(+), 24 deletions(-)
diff --git a/fs/dax.c b/fs/d
1 - 100 of 187 matches
Mail list logo