Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3007232pxb; Fri, 12 Feb 2021 07:03:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJyOySHKQjI+TVCxTg6T8kv94GBc9D0uVXP05/YDek5E+X840r/KwyPhhZmV/sOnRJKNStj7 X-Received: by 2002:a17:906:6d5:: with SMTP id v21mr3374346ejb.282.1613142235918; Fri, 12 Feb 2021 07:03:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613142235; cv=none; d=google.com; s=arc-20160816; b=rAEuOViDmzdzJqERr66ycxkYUUdGbbaZOKhm0IS0ZWdjojycdPAdfJKi5+iK63MJTs MYotn2vcJgWYHLccbYnWEuiRqEPuU14MBEqX4DdAe66W4/EQrG1QteJqE9fYnRUzBi+J 3j0rQLw6m0H5vUQ7HJetgXEEUR+IG6bl2mltZBzkwqpGBpQF6kU9nFPwziyqKf+HszPF J0VD53u0wrYSulc9oeBki2Wwa2LGhfljPEA0doByor6/aP+mMKuHMFNQ96cJ0J4sXgCv oIJj2640N9b59dpD2y4Xv0w6R5WIAq2nC6e0AfatPjpNdYr2kOWDmsUSTzoX/QAWCuc9 mLkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:in-reply-to:date :references:subject:cc:to:from; bh=76bwXVR0Rk0UNz0JQOuCBmGVI8N+yw3QeLz2NpdVIR4=; b=qh+jn6D8+Ssbczly7OYZ93Vow00Ckcl59s0Hi2hwqfEr1zqCEnvutPNyZF+R8o9bD2 3MlzQ6OBPG/9Qpfh8qOcWMREW1u0hGd0GuZv3NNF2N0axzcZA2vt4T/jsIwirTLzmFJa I221kIoceYbPFiVNY+4Xvjo1FjdrQlRl869T94H+XTJcVtNPJyLvmHVS34Fwskza/CVk UywxwJDmj5o8Q7/EgOPFA196wk58jHRGFtGDRpSkmrdM51+27o41h1qMsbwpa/ToJ4kk 2U9Fxro4COSV00pgn6xPAWdaVeH5JjVlCJV1WRoyQOyNazatgP8MA3zuTCl/pkgeNiQy 2cwQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ot7si6592548ejb.88.2021.02.12.07.03.32; Fri, 12 Feb 2021 07:03:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229531AbhBLPBg (ORCPT + 99 others); Fri, 12 Feb 2021 10:01:36 -0500 Received: from mx2.suse.de ([195.135.220.15]:43894 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229465AbhBLPBf (ORCPT ); Fri, 12 Feb 2021 10:01:35 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 014C8AC90; Fri, 12 Feb 2021 15:00:54 +0000 (UTC) Received: from localhost (brahms [local]) by brahms (OpenSMTPD) with ESMTPA id d8a92aa3; Fri, 12 Feb 2021 15:01:55 +0000 (UTC) From: Luis Henriques To: Greg KH Cc: Jeff Layton , Amir Goldstein , Nicolas Boichat , "Darrick J . Wong" , Alexander Viro , Ian Lance Taylor , Luis Lozano , Dave Chinner , linux-fsdevel , linux-kernel Subject: Re: [PATCH 1/6] fs: Add flag to file_system_type to indicate content is generated References: <20210212044405.4120619-1-drinkcat@chromium.org> <20210212124354.1.I7084a6235fbcc522b674a6b1db64e4aff8170485@changeid> <871rdljxtx.fsf@suse.de> <87sg61ihkj.fsf@suse.de> Date: Fri, 12 Feb 2021 15:01:54 +0000 In-Reply-To: (Greg KH's message of "Fri, 12 Feb 2021 15:11:14 +0100") Message-ID: <87lfbtib31.fsf@suse.de> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Greg KH writes: > On Fri, Feb 12, 2021 at 12:41:48PM +0000, Luis Henriques wrote: >> Greg KH writes: ... >> >> >> Our option now are: >> >> >> - Restore the cross-fs restriction into generic_copy_file_range() >> >> > >> >> > Yes. >> >> > >> >> >> >> Restoring this restriction will actually change the current cephfs CFR >> >> behaviour. Since that commit we have allowed doing remote copies between >> >> different filesystems within the same ceph cluster. See commit >> >> 6fd4e6348352 ("ceph: allow object copies across different filesystems in >> >> the same cluster"). >> >> >> >> Although I'm not aware of any current users for this scenario, the >> >> performance impact can actually be huge as it's the difference between >> >> asking the OSDs for copying a file and doing a full read+write on the >> >> client side. >> > >> > Regression in performance is ok if it fixes a regression for things that >> > used to work just fine in the past :) >> > >> > First rule, make it work. >> >> Sure, I just wanted to point out that *maybe* there are other options than >> simply reverting that commit :-) >> >> Something like the patch below (completely untested!) should revert to the >> old behaviour in filesystems that don't implement the CFR syscall. >> >> Cheers, >> -- >> Luis >> >> diff --git a/fs/read_write.c b/fs/read_write.c >> index 75f764b43418..bf5dccc43cc9 100644 >> --- a/fs/read_write.c >> +++ b/fs/read_write.c >> @@ -1406,8 +1406,11 @@ static ssize_t do_copy_file_range(struct file *file_in, loff_t pos_in, >> file_out, pos_out, >> len, flags); >> >> - return generic_copy_file_range(file_in, pos_in, file_out, pos_out, len, >> - flags); >> + if (file_inode(file_in)->i_sb != file_inode(file_out)->i_sb) >> + return -EXDEV; >> + else >> + generic_copy_file_range(file_in, pos_in, file_out, pos_out, len, >> + flags); >> } >> >> /* > > That would make much more sense to me. Great. I can send a proper patch with changelog, if this is the really what we want. But I would rather hear from others first. I guess that at least the NFS devs have something to say here. Cheers, -- Luis