Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp398914ybx; Tue, 29 Oct 2019 21:15:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqzKzh1bp0GfNnSacAKVaefRZrKrnn2VydJKnzSRBrmTlGykX5PKEL8cdVtfvXrVgA36YRuN X-Received: by 2002:a50:bb48:: with SMTP id y66mr29805413ede.66.1572408916172; Tue, 29 Oct 2019 21:15:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572408916; cv=none; d=google.com; s=arc-20160816; b=KamuRdEgKdrpYKKxdIiyIW/QHijY7AsHPZISyvx5+TOzQG6AAbxzcAK5WvTP1jLrg0 EmiLVYUQldlpeysrRqKAyF3NEph/dzERODqWvHqjxhuzX+aJj93wjgTUJlPA3mbq2lmK e0TMWPv7/EEL0zObk9VE6pHY1xr4D+iq5joBiJwB9hvE3kCQ0Z1Hx8Lz4gW0eZKdf+37 qfJLHUihb+q7JMqWOp9m5B5D5G4EKcONhd0BI+YOGYVuLr42akC9wcDb3bPUorpAJlic 263AYV7KvCR67Md59/XPhWN6Pe5/aTavrWN62omgRuoqfldTAUVMpvbiE7es+/wq8GPj vR7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=FCjRW1I15wpK+dSyj2r/kOoRtC71lUGcxRThBOrkhZw=; b=g9OiqAspPISacpenjb33Eci8xkFkMucVd+DdwYGXCbRWxVc0WG5EMo74KnKJUbHnyx uH+A8G0THQUMbvzGwMdw6DVQNobD9IJueJUC8iAIQsPtOcFAFd1Q/nNMvsTgladuHEfq ruaQvK1fmaQ37ThXjYDHn+qTBJRTpjNo8/L+x5KaNuysbHa7PXS6Y6+oT8LEFMH3SktC /mAS+4QsOaNYEynJywbs4/TbQl2n/RvJCgc+1sJqQlN0tgrD3FT0R+p7G0MTyqiBmbEK r+XU6CTP+pwGX7A3KMQW5JNLS+ID2XOAyMSxKFuh0HcLuUpzHJoWx1v8sevYi8sVqT1f 94jg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t18si454763ejf.351.2019.10.29.21.14.53; Tue, 29 Oct 2019 21:15:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726918AbfJ3EOR (ORCPT + 99 others); Wed, 30 Oct 2019 00:14:17 -0400 Received: from mail.cn.fujitsu.com ([183.91.158.132]:45395 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725855AbfJ3EOR (ORCPT ); Wed, 30 Oct 2019 00:14:17 -0400 X-IronPort-AV: E=Sophos;i="5.68,245,1569254400"; d="scan'208";a="77665111" Received: from unknown (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 30 Oct 2019 12:14:14 +0800 Received: from G08CNEXCHPEKD01.g08.fujitsu.local (unknown [10.167.33.80]) by cn.fujitsu.com (Postfix) with ESMTP id 3C6C34B6AE15; Wed, 30 Oct 2019 12:06:16 +0800 (CST) Received: from localhost.localdomain (10.167.225.140) by G08CNEXCHPEKD01.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 30 Oct 2019 12:14:24 +0800 From: Shiyang Ruan To: , , , , , CC: , , , , Subject: [RFC PATCH v2 0/7] xfs: reflink & dedupe for fsdax (read/write path). Date: Wed, 30 Oct 2019 12:13:51 +0800 Message-ID: <20191030041358.14450-1-ruansy.fnst@cn.fujitsu.com> X-Mailer: git-send-email 2.17.0 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.167.225.140] X-yoursite-MailScanner-ID: 3C6C34B6AE15.A4452 X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: ruansy.fnst@cn.fujitsu.com X-Spam-Status: No Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patchset aims to take care of this issue to make reflink and dedupe work correctly (actually in read/write path, there still has some problems, such as the page->mapping and page->index issue, in mmap path) in XFS under fsdax mode. It is based on Goldwyn's patchsets: "v4 Btrfs dax support" and the latest iomap. I borrowed some patches related and made a few fix to make it basically works fine. For dax framework: 1. adapt to the latest change in iomap (two iomaps). For XFS: 1. distinguish dax write/zero from normal write/zero. 2. remap extents after COW. 3. add file contents comparison function based on dax framework. 4. use xfs_break_layouts() instead of break_layout to support dax. Goldwyn Rodrigues (3): dax: replace mmap entry in case of CoW fs: dedup file range to use a compare function dax: memcpy before zeroing range Shiyang Ruan (4): dax: Introduce dax_copy_edges() for COW. dax: copy data before write. xfs: handle copy-on-write in fsdax write() path. xfs: support dedupe for fsdax. fs/btrfs/ioctl.c | 3 +- fs/dax.c | 211 +++++++++++++++++++++++++++++++++++++---- fs/iomap/buffered-io.c | 8 +- fs/ocfs2/file.c | 2 +- fs/read_write.c | 11 ++- fs/xfs/xfs_bmap_util.c | 6 +- fs/xfs/xfs_file.c | 10 +- fs/xfs/xfs_iomap.c | 3 +- fs/xfs/xfs_iops.c | 11 ++- fs/xfs/xfs_reflink.c | 79 ++++++++------- include/linux/dax.h | 16 ++-- include/linux/fs.h | 9 +- 12 files changed, 291 insertions(+), 78 deletions(-) -- 2.23.0