From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ua1-f65.google.com ([209.85.222.65]:38964 "EHLO mail-ua1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727507AbeJZUtV (ORCPT ); Fri, 26 Oct 2018 16:49:21 -0400 MIME-Version: 1.0 References: <20181024195837.35532-1-olga.kornievskaia@gmail.com> <20181024195837.35532-5-olga.kornievskaia@gmail.com> In-Reply-To: From: Olga Kornievskaia Date: Fri, 26 Oct 2018 08:12:15 -0400 Message-ID: Subject: Re: [PATCH v2 03/13] OverlayFS: add cross-device check for copy_file_range To: Amir Goldstein Cc: trond.myklebust@hammerspace.com, Anna Schumaker , viro@zeniv.linux.org.uk, Steve French , Miklos Szeredi , linux-nfs , linux-fsdevel@vger.kernel.org, linux-cifs@vger.kernel.org, linux-unionfs@vger.kernel.org, linux-man@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Thu, Oct 25, 2018 at 1:54 AM Amir Goldstein wrote: > > On Wed, Oct 24, 2018 at 10:59 PM Olga Kornievskaia > wrote: > > > > From: Olga Kornievskaia > > > > VFS copy_file_range was relaxed to allow for cross-device copy. > > Add a check for now, to disallow cross-device copy offload until > > appropriate support is added. > > > > Signed-off-by: Olga Kornievskaia > > ` > > --- > > fs/overlayfs/file.c | 3 +++ > > 1 file changed, 3 insertions(+) > > > > diff --git a/fs/overlayfs/file.c b/fs/overlayfs/file.c > > index aeaefd2..5282853 100644 > > --- a/fs/overlayfs/file.c > > +++ b/fs/overlayfs/file.c > > @@ -483,6 +483,9 @@ static ssize_t ovl_copy_file_range(struct file *file_in, loff_t pos_in, > > struct file *file_out, loff_t pos_out, > > size_t len, unsigned int flags) > > { > > + if (file_in->f_inode->i_sb != file_out->f_inode->i_sb) > > + return -EXDEV; > > > > Note that this could be relaxed later on to same fs type > allowing for cross container copy_file_range() to be performced > as clone_file_range() when upper is a shared fs with clone support. > > Don't worry about it though, I can make this change later after testing > the use case. > > As long as this patch comes in the series *before* relaxing the VFS check, > You may add: > Reviewed-by: Amir Goldstein Given that this patch was merged I didn't add "reviewed-by" line. Please let me know I need to add this line to the main VFS patch. > > Thanks, > Amir.