lkml.org 
[lkml]   [2021]   [Aug]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v7 8/8] fs/xfs: Add dax dedupe support
From
Date


On 2021/8/20 11:08, Dan Williams wrote:
> On Sun, Aug 15, 2021 at 11:05 PM Shiyang Ruan <ruansy.fnst@fujitsu.com> wrote:
>>
>> 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 <ruansy.fnst@fujitsu.com>
>> Reviewed-by: Darrick J. Wong <djwong@kernel.org>
>> ---
>> fs/xfs/xfs_file.c | 2 +-
>> fs/xfs/xfs_inode.c | 57 ++++++++++++++++++++++++++++++++++++++++++++
>> fs/xfs/xfs_inode.h | 1 +
>> fs/xfs/xfs_reflink.c | 4 ++--
>> 4 files changed, 61 insertions(+), 3 deletions(-)
> [..]
>> diff --git a/fs/xfs/xfs_reflink.c b/fs/xfs/xfs_reflink.c
>> index 13e461cf2055..86c737c2baeb 100644
>> --- a/fs/xfs/xfs_reflink.c
>> +++ b/fs/xfs/xfs_reflink.c
>> @@ -1327,8 +1327,8 @@ xfs_reflink_remap_prep(
>> if (XFS_IS_REALTIME_INODE(src) || XFS_IS_REALTIME_INODE(dest))
>> goto out_unlock;
>>
>> - /* Don't share DAX file data for now. */
>> - if (IS_DAX(inode_in) || IS_DAX(inode_out))
>> + /* Don't share DAX file data with non-DAX file. */
>> + if (IS_DAX(inode_in) != IS_DAX(inode_out))
>> goto out_unlock;
>
> What if you have 2 DAX inodes sharing data and one is flipped to
> non-DAX? Does that operation need to first go undo all sharing?
>

Yes, I think it is needed to unshare the extents when the DAX flags of
the file is changed. I'll look into it.


--
Thanks,
Ruan.


\
 
 \ /
  Last update: 2021-08-27 05:37    [W:0.055 / U:0.368 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site