Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp968688pxb; Thu, 26 Aug 2021 20:37:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyjzmfBBiHTThrQG5CNaUyxR39SHN4hcfKt5muLdY7N6qAwXGQ2OmRbbh2h8K664gnYAtwq X-Received: by 2002:a5e:d712:: with SMTP id v18mr5601285iom.65.1630035441510; Thu, 26 Aug 2021 20:37:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630035441; cv=none; d=google.com; s=arc-20160816; b=JWn0cJ4M9nOgv31R5J3DTS87nL+HDosVF4uLxDl39Q5VqRXVzuoTkfpWFjRHo+KdBd JS4J13l4c2W6KZ+LX0GKUPZ2/QcWsG3iC4bxD0yYZFlAUuUriPQdLmZOmCk7G47c++aW u5yWSwAH0Sic+YBz8q9jOYkHtV2ZaZo/9eHfhSp4iV75w85aK9olOQ2W4Mwbh2253aGB V8s91mVKMCj+GH7aCIuL6M0H2YNs+dNvFh2dQgF7d8dgr7IgPxfmvCySaWt57HZfhFdG Z+WUoEKduBWMXS9IABNrRL60/OFRpnoTFTgoOwqHPwIByeUNMzJOl/0Is0r4UlIkHigm xpxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:references:cc:to :subject:ironport-hdrordr; bh=e/HztdAiJg001rEctjw9G5EhOY07yw3+j952rPRtoAw=; b=DPm8/Qua665KkuOiml7DtYcVzDbyDr9L5FQjVJoS5nJHa+z1N6m0pJ81feCsjaIEW/ he4ACwgrATFCYZZae9YunnflvLVcgND2FVKZ906l2urTW8MJ6tB1/J6mdH5jTNvXm5TT Uwc9p0XEaGF3wWqPJYIDfSMD/IlA7RSoIhezuhat0yTSi5GbJLKUzDian9etpCkBAu8x EgaxzL9URw/0dRpLndV/a1CkhliGrcyI9zP9LgGV1uYtO52SWrKBJ2Vov2Me/6nBKhbo FP5ZRWN12pYVj9TOEmx2VbPZpG1k7SzEm8bI5xONCBzbWWZ5EhmVoUSOuqSlp8nAWQo4 99CQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=fujitsu.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j9si4590380ilr.97.2021.08.26.20.37.09; Thu, 26 Aug 2021 20:37:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=fujitsu.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244100AbhH0DhO (ORCPT + 99 others); Thu, 26 Aug 2021 23:37:14 -0400 Received: from mail.cn.fujitsu.com ([183.91.158.132]:34486 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S232285AbhH0DhN (ORCPT ); Thu, 26 Aug 2021 23:37:13 -0400 IronPort-HdrOrdr: =?us-ascii?q?A9a23=3A/3r6Ka0QAwqOj5LEEHSvPAqjBI4kLtp133Aq?= =?us-ascii?q?2lEZdPU1SL39qynKppkmPHDP5gr5J0tLpTntAsi9qBDnhPtICOsqTNSftWDd0Q?= =?us-ascii?q?PGEGgI1/qB/9SPIU3D398Y/aJhXow7M9foEGV95PyQ3CCIV/om3/mLmZrFudvj?= X-IronPort-AV: E=Sophos;i="5.84,355,1620662400"; d="scan'208";a="113547097" Received: from unknown (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 27 Aug 2021 11:36:23 +0800 Received: from G08CNEXMBPEKD06.g08.fujitsu.local (unknown [10.167.33.206]) by cn.fujitsu.com (Postfix) with ESMTP id BC6444D0D4BD; Fri, 27 Aug 2021 11:36:18 +0800 (CST) Received: from G08CNEXCHPEKD09.g08.fujitsu.local (10.167.33.85) by G08CNEXMBPEKD06.g08.fujitsu.local (10.167.33.206) with Microsoft SMTP Server (TLS) id 15.0.1497.23; Fri, 27 Aug 2021 11:36:12 +0800 Received: from [192.168.22.65] (10.167.225.141) by G08CNEXCHPEKD09.g08.fujitsu.local (10.167.33.209) with Microsoft SMTP Server id 15.0.1497.23 via Frontend Transport; Fri, 27 Aug 2021 11:36:12 +0800 Subject: Re: [PATCH v7 8/8] fs/xfs: Add dax dedupe support To: Dan Williams CC: "Darrick J. Wong" , Christoph Hellwig , linux-xfs , david , linux-fsdevel , Linux Kernel Mailing List , Linux NVDIMM , Goldwyn Rodrigues , Al Viro , Matthew Wilcox References: <20210816060359.1442450-1-ruansy.fnst@fujitsu.com> <20210816060359.1442450-9-ruansy.fnst@fujitsu.com> From: Shiyang Ruan Message-ID: <624617e3-3353-a63a-ff71-f034d5763650@fujitsu.com> Date: Fri, 27 Aug 2021 11:36:11 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-yoursite-MailScanner-ID: BC6444D0D4BD.A09A5 X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: ruansy.fnst@fujitsu.com X-Spam-Status: No Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021/8/20 11:08, Dan Williams wrote: > On Sun, Aug 15, 2021 at 11:05 PM Shiyang Ruan 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 >> Reviewed-by: Darrick J. Wong >> --- >> 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.