From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi0-f43.google.com ([209.85.218.43]:33465 "EHLO mail-oi0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754180AbcJ1OZa (ORCPT ); Fri, 28 Oct 2016 10:25:30 -0400 Received: by mail-oi0-f43.google.com with SMTP id y2so124556861oie.0 for ; Fri, 28 Oct 2016 07:25:29 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <1477510441-24861-1-git-send-email-amir73il@gmail.com> References: <1477510441-24861-1-git-send-email-amir73il@gmail.com> From: Miklos Szeredi Date: Fri, 28 Oct 2016 16:25:28 +0200 Message-ID: Subject: Re: [PATCH] vfs: fix vfs_clone_file_range() for overlayfs files To: Amir Goldstein Cc: Al Viro , Christoph Hellwig , "linux-unionfs@vger.kernel.org" , linux-fsdevel@vger.kernel.org Content-Type: text/plain; charset=UTF-8 Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Wed, Oct 26, 2016 at 9:34 PM, Amir Goldstein wrote: > With overlayfs, it is wrong to compare file_inode(inode)->i_sb > of regular files with those of non-regular files, because the > former reference the real (upper/lower) sb and the latter reference > the overlayfs sb. > > Move the test for same super block after the sanity tests for > clone range of directory and non-regular file. Better: compare ->f_path.dentry->d_sb instead of file_inode()->i_sb. We don't want to be mixing files that come from overlayfs and ones that come from the underlying layers. BTW, would it be worthwhile adding clone_file_range() support to overlayfs? Thanks, Miklos