[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <624617e3-3353-a63a-ff71-f034d5763650@fujitsu.com>
Date: Fri, 27 Aug 2021 11:36:11 +0800
From: Shiyang Ruan <ruansy.fnst@...itsu.com>
To: Dan Williams <dan.j.williams@...el.com>
CC: "Darrick J. Wong" <djwong@...nel.org>,
Christoph Hellwig <hch@....de>,
linux-xfs <linux-xfs@...r.kernel.org>,
david <david@...morbit.com>,
linux-fsdevel <linux-fsdevel@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Linux NVDIMM <nvdimm@...ts.linux.dev>,
Goldwyn Rodrigues <rgoldwyn@...e.de>,
Al Viro <viro@...iv.linux.org.uk>,
Matthew Wilcox <willy@...radead.org>
Subject: Re: [PATCH v7 8/8] fs/xfs: Add dax dedupe support
On 2021/8/20 11:08, Dan Williams wrote:
> On Sun, Aug 15, 2021 at 11:05 PM Shiyang Ruan <ruansy.fnst@...itsu.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@...itsu.com>
>> Reviewed-by: Darrick J. Wong <djwong@...nel.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.
Powered by blists - more mailing lists