From patchwork Mon Oct 29 17:40:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Olga Kornievskaia X-Patchwork-Id: 10659879 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0DFE63E9D for ; Mon, 29 Oct 2018 17:41:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0466E29B43 for ; Mon, 29 Oct 2018 17:41:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ECD9F29BCB; Mon, 29 Oct 2018 17:41:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A22AC29C79 for ; Mon, 29 Oct 2018 17:41:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727998AbeJ3Can (ORCPT ); Mon, 29 Oct 2018 22:30:43 -0400 Received: from mail-qk1-f194.google.com ([209.85.222.194]:34909 "EHLO mail-qk1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726330AbeJ3Can (ORCPT ); Mon, 29 Oct 2018 22:30:43 -0400 Received: by mail-qk1-f194.google.com with SMTP id v68-v6so5476548qka.2; Mon, 29 Oct 2018 10:41:06 -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:in-reply-to:references; bh=zRxwbIgi/nx4F/08g2W9WJaMoLvFn8Iu27inV//7XF0=; b=ceA7t9HxW4jDusqAbre11zG+DExfHQckhjpqyIrPyYLKB5PTzHG5HHDP1CHOcMe1dU wxmf/ONl57Po59DZK6rhEK6amKU9R1ewN71Mtl5g/snNJ3RVloGU4xJq7yqK8VCE6wk6 qshENUnrKH/I5CRUbf11+ZvpbV0hBeKrxoyVSYkmsBmK+R0B3zNer7L2T3gHfANjcTEY zf/CpfY/WofHwlYAZUuK+FuinKu2wlJSiJSpRRhIf/p0ErGxsmOMOP3yUXSc8Qy6jGCm 87l6/oP+B4etOGzk90QdQuW4DQZZynhoMaAPcRi4p3/0UJz4xb2rzKB/+EBdjF00Vj0d veUQ== 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:in-reply-to :references; bh=zRxwbIgi/nx4F/08g2W9WJaMoLvFn8Iu27inV//7XF0=; b=kqySjfztgvGHtrzQiwmJ7piujUjbd29y+ZBbqmBEmWMankOfLOVxDniRIIDfXPMoRy O1kHxKCToIMAPXTqhhF4LEHll7PS2OfN4wBI54RfSufl6S5ChnH8ReUXtosS9ZQT2J1H t7oWJ/h47TtAc/2f7w0/hUgFSofNnV4pVANzPhl+woi2ePsoCPcygdbE84463VRDVhki oMaqoa6iTtCI7EJL9mFyyOGB6o2ce+K5NEG1T5nGZMFfm0MLhImIcqOK5WJbjQ4uKmQz sssZk6RxqWHl7aVGCpNbPkZcxVEdKFjzGFl54diI5eizDpaHy6nrPv1k1iUbp5bfkNmx s7bQ== X-Gm-Message-State: AGRZ1gJALmUdlw4/YPa2ylzB19T7nUejMKliYu2ctvrFmLcQWqXWG0Ci yRivxBZjag/e5IKwIdkGkBo= X-Google-Smtp-Source: AJdET5clmZ4KkA1z1jTzMW7SGVitgJuL0Mcvzbkvw8WUNnfMha7xN/I4DtmTDCZ3cyxDVDJRAK0Dtg== X-Received: by 2002:a37:a5d1:: with SMTP id o200mr12943420qke.328.1540834866347; Mon, 29 Oct 2018 10:41:06 -0700 (PDT) Received: from Olgas-MBP-195.attlocal.net (172-10-226-31.lightspeed.livnmi.sbcglobal.net. [172.10.226.31]) by smtp.gmail.com with ESMTPSA id n190-v6sm13148929qkb.29.2018.10.29.10.41.04 (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 29 Oct 2018 10:41:05 -0700 (PDT) From: Olga Kornievskaia To: trond.myklebust@hammerspace.com, anna.schumaker@netapp.com, viro@zeniv.linux.org.uk, smfrench@gmail.com, miklos@szeredi.hu Cc: linux-nfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-cifs@vger.kernel.org, linux-unionfs@vger.kernel.org, linux-man@vger.kernel.org Subject: [PATCH v5 02/12] VFS: generic cross-device copy_file_range() support for all filesystems Date: Mon, 29 Oct 2018 13:40:49 -0400 Message-Id: <20181029174059.38326-4-olga.kornievskaia@gmail.com> X-Mailer: git-send-email 2.10.1 (Apple Git-78) In-Reply-To: <20181029174059.38326-1-olga.kornievskaia@gmail.com> References: <20181029174059.38326-1-olga.kornievskaia@gmail.com> Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Olga Kornievskaia If a filesystem does not support cross device or cross file system type copy offload functionality, then this patch provides a fallback to a page cache based physical data copy. This means the copy_file_range() systemcall will never fail with EXDEV, and so in future userspace will not need to detect or provide a fallback for failed cross-device copies anymore. Signed-off-by: Olga Kornievskaia Reviewed-by: Matthew Wilcox --- fs/read_write.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/read_write.c b/fs/read_write.c index 7a912e3..cff59bd 100644 --- a/fs/read_write.c +++ b/fs/read_write.c @@ -1597,7 +1597,7 @@ ssize_t vfs_copy_file_range(struct file *file_in, loff_t pos_in, if (file_out->f_op->copy_file_range) { ret = file_out->f_op->copy_file_range(file_in, pos_in, file_out, pos_out, len, flags); - if (ret != -EOPNOTSUPP) + if (ret != -EOPNOTSUPP && ret != -EXDEV) goto done; }