Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp6642047ybi; Wed, 29 May 2019 10:43:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqwES8sGBnXbVvi0WTwnYOJikAbcbhJ8YFW8OLHccGlUlFbmuuTFehmnuxNLnmKWTWbuoXQ4 X-Received: by 2002:a17:902:4e:: with SMTP id 72mr91652344pla.80.1559151836021; Wed, 29 May 2019 10:43:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559151836; cv=none; d=google.com; s=arc-20160816; b=u1uSXESGpYxyz3Q1K8iZjHvt+o5rDfWJHhYMuhvn9lXHV/qJjxgzaEum+bB0aMi9hB wMxKJSaHDFp4z3RgPgLADp6fHmm4g58fUn5QiRP4x7J29ffU8gGgtgbZOwSdCtzBCee0 uX5MR0qhQ9figoAoJcc4i1zj7hEUcXYdbL7gijbz4SpjylhcOHvHMQV7XynR7/p/xyub wIVGbbA/DCXd7uT2NgEWI0jBbn9nckAgWoBp3CrZQoNmB6KVETfa5PMWq4PqAytuPrbE iDBfzR3WjyxgY17X23PUiTjtLKLO0czbUNu4ln9FD8LOiXaOcVrE0SanuurTQ2rLuAmn 9m8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=SUYnB2bg4AR5y4HlcGNuWGzeCbLRgpuJBmh6fn5CpA4=; b=mDmc+KEVsmkt4aqyt1pGW7xPY7o7FoLPObUYZV7x+gxIWeuSUM/IDw3wqvH1H+92KY r+PFIqES2mz/1bfhIy2pwvyzafzrvfaBHRwa0sEE89ZdexOSOJpqWy1Y0hR0jdtbyoDz 1xyY+dO8+dpf4Bvth0u/WYfS4TUnGXXIRInP0bzkXsvSwDsBJ4m6AjJNhaZS149cY3wU fyGDuTFGpXT4isKIiPpTGuAJkhD04koAcqhIfXBaCINGJP8d1uaBhccn+J71igc6Qq49 Q5HRk2HVDWXLhjtyYBGTXtedQniuv0/u/BtrXZNHV97EwIw5v9eXofe+PC3zrRQMATpX ieQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=f17Sh1HP; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i193si350629pgd.88.2019.05.29.10.43.31; Wed, 29 May 2019 10:43:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=f17Sh1HP; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726054AbfE2Rna (ORCPT + 99 others); Wed, 29 May 2019 13:43:30 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:38020 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725917AbfE2Rna (ORCPT ); Wed, 29 May 2019 13:43:30 -0400 Received: by mail-wr1-f66.google.com with SMTP id d18so2396174wrs.5; Wed, 29 May 2019 10:43:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=SUYnB2bg4AR5y4HlcGNuWGzeCbLRgpuJBmh6fn5CpA4=; b=f17Sh1HPDc9bYMG1afQL0SErA2OLPo6bzs0M+RgImWRrvuYAE6X+IRRxhBfn2W8n0E GHV5S3VSKLum2UZG2m5jEEwK8YJoCH6NU8hq8TTgEr1vT6rIGaAS1my/czWl8uffAP0/ Cu2fC0uC3HP8OIJi+W6ZBzEcsH05bCQsoWY2DcsxobER2+mSj7/5QtCDqY7JLuPOvPdz 9YN5j/7+voP6EZ0q9aJ/GFALf7QeTIaoY8iWAKvRTcYOr6KnA96A+TZwu1T/A/V1q5GD hxkR7JeYoG95+ckNoW0Loz5RBtdwNSSwHXQUyeOgzTHAdWjwQpffAZZeHtflgtnYlu0v QDZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=SUYnB2bg4AR5y4HlcGNuWGzeCbLRgpuJBmh6fn5CpA4=; b=qxQcZ7L8a0kPUxyDe7dxpZBc6DpickgHPFEu1mzucgzgLCq37HfZr5CvRlUshF8h2g ArBrim/vZtlJ7EbFWJ7qgW3ifAwy3xq4DcXGJoIWpj1ByO/d2w7yfUJV7GnK7IcvOGNI 6r/sRgYTlSLYMVV//F/fYPVYOuAZe+QxrifOBlUtaW+1bGDBBQadImUxGWIyp7XHllfM 7mfOVddkfap5Ehg4+h8uWc3x/YmI8bUSSiHaBrrQ3S8LYKm7IQsuvHg2Puu04OUoWHpf nRJxEMjWA0UEJBmTcMNglYKm6hCGtThuv6adeq8GxXIBk6UKS/gXAGd0nGAJKCy3ZWdA iUjg== X-Gm-Message-State: APjAAAVzkUH9n5/ITQUGy3IP6XQloCOZM2w5Jmky3/E8PwLLH5uuWRjO X6ULJpAM2qCOovs9dntWIcs= X-Received: by 2002:a5d:6b03:: with SMTP id v3mr22768077wrw.309.1559151807660; Wed, 29 May 2019 10:43:27 -0700 (PDT) Received: from localhost.localdomain ([5.102.238.208]) by smtp.gmail.com with ESMTPSA id k125sm31702wmb.34.2019.05.29.10.43.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 May 2019 10:43:26 -0700 (PDT) From: Amir Goldstein To: "Darrick J . Wong" Cc: Dave Chinner , Christoph Hellwig , linux-xfs@vger.kernel.org, Olga Kornievskaia , Luis Henriques , Al Viro , linux-fsdevel@vger.kernel.org, linux-api@vger.kernel.org, ceph-devel@vger.kernel.org, linux-nfs@vger.kernel.org, linux-cifs@vger.kernel.org Subject: [PATCH v3 00/13] Fixes for major copy_file_range() issues Date: Wed, 29 May 2019 20:43:04 +0300 Message-Id: <20190529174318.22424-1-amir73il@gmail.com> X-Mailer: git-send-email 2.17.1 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Hi Darrick, Following is a re-work of Dave Chinner's copy_file_range() patches. This v3 patch set is based on your feedback to v2 [1]. NOTE that this work changes user visible behavior of copy_file_range(2)! It introduces new errors for cases that were not checked before and it allows cross-device copy by default. After this work, cifs copy offload should be possible between two shares on the same server, but I did not check this functionality. Patches 1-3 have your Reviewed-by. Patches 4-5 have been slightly amended to address your comments. Patch 6 adds the new helper you requested dubbed file_modified(). Patch 7 uses the helper in xfs - unrelated to copy_file_range(). Patches 8-12 use the helper for various fs's ->copy_file_range(). Patch 13 (unmodified) has your Reviewed-by, because the bits that you approved are those that matter to most filesystems (i.e. the fallback logic). The man page update patch (again, mostly Dave's work) is appended to the series with fixes to your review comments. Thanks, Amir. [1] https://lore.kernel.org/linux-fsdevel/20190526061100.21761-1-amir73il@gmail.com/ Changes since v2: - Re-order generic_remap_checks() fix patch before forking generic_copy_file_checks() - Document @req_count helper argument (Darrick) - Fold generic_access_check_limits() (Darrick) - Added file_modified() helper (Darrick) - Added xfs patch to use file_modified() helper - Drop generic_copy_file_range_prep() helper - Per filesystem patch for file_modified()/file_accessed() - Post copy file_remove_privs() for ceph/generic (Darrick) Changes since v1: - Short read instead of EINVAL (Christoph) - generic_file_rw_checks() helper (Darrick) - generic_copy_file_range_prep() helper (Christoph) - Not calling ->remap_file_range() with different sb - Not calling ->copy_file_range() with different fs type - Remove changes to overlayfs - Extra fix to clone/dedupe checks Amir Goldstein (11): vfs: introduce generic_file_rw_checks() vfs: remove redundant checks from generic_remap_checks() vfs: add missing checks to copy_file_range vfs: introduce file_modified() helper xfs: use file_modified() helper vfs: copy_file_range needs to strip setuid bits and update timestamps ceph: copy_file_range needs to strip setuid bits and update timestamps cifs: copy_file_range needs to strip setuid bits and update timestamps fuse: copy_file_range needs to strip setuid bits and update timestamps nfs: copy_file_range needs to strip setuid bits and update timestamps vfs: allow copy_file_range to copy across devices Dave Chinner (2): vfs: introduce generic_copy_file_range() vfs: no fallback for ->copy_file_range fs/ceph/file.c | 40 ++++++++++++- fs/cifs/cifsfs.c | 15 ++++- fs/fuse/file.c | 29 ++++++++- fs/inode.c | 20 +++++++ fs/nfs/nfs42proc.c | 9 ++- fs/nfs/nfs4file.c | 23 ++++++- fs/read_write.c | 145 ++++++++++++++++++++++++++++----------------- fs/xfs/xfs_file.c | 15 +---- include/linux/fs.h | 9 +++ mm/filemap.c | 110 +++++++++++++++++++++++++++------- 10 files changed, 309 insertions(+), 106 deletions(-) -- 2.17.1