Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp4841347pxb; Mon, 15 Feb 2021 02:41:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJw1PYowd6Zt+Yu39zSNtMu7Auma0JqWA/YQ3UUtjwc3eJAGyUTId5J+xWCcNc5sH38jS6Uo X-Received: by 2002:a17:906:1d44:: with SMTP id o4mr12635690ejh.130.1613385674671; Mon, 15 Feb 2021 02:41:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613385674; cv=none; d=google.com; s=arc-20160816; b=rJ4cQsgCFVW7BQcb9chUVSZwKTYagblq95Asz/SL4QDDSskegw9hARyvs/nqJ/w+Gs y/RUY/nH6pcqWaOwjRSbVrki0Ugg7yhdoxHYlvWS2zifFJNnY3n3oj66Hgx/0oqLfGgt mtJoT3LGksxxzJz56rwybchaSUC0k9RIMw+mUVParXBFJV5AaSJq5eQK1mGrlNbeyfxN VFZngBaFzNlJ9bIvc/e5xqciGG09Pd3aYUwRwh0znY+mz58mQPoDaYgImbT8eQitdy/K Vjpyysjmnf7ll2X5TXMitnM/NkMpsToAB8HeMQeifPr7bvbkjY9atihtJV/YlP46M1MB Nfrg== 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=kzzd7OubhPspGC6eWltNISObfsYq4rl2XliSxeDgPOI=; b=WzR20W0iqB5WL/1w5rgQ2UKPXi9CkQNGPuew96wm47ZTG0SE3G7/gjnFFg3jkXlFYU brRphpAUcayYLTEnNsV4/80lswhg503JzC6IwxUO+uA3MwTeEmTcPRfbt3KUN9QjmmZx sz3xvyFgZ1XCA8YWyaCaAntENTD8RzRjMbqCe1A+GXAw9mUV0ryQWy0o0v2Mqy7y1MoY xEhjil6CCK6XNKNhSpn7XIq/WGIA+uF9jLYeTMvNj9zXJN6ncuo/YRhhnLhk43hFaB+g PH5s0LG39tr4n9aSlKeXOlLcIt2zz56m2sVjWe3EtAyIydwuV/dafLao9kGGV7bsv181 +QOA== 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 r4si14318933edi.177.2021.02.15.02.40.52; Mon, 15 Feb 2021 02:41:14 -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 S230175AbhBOKjE (ORCPT + 99 others); Mon, 15 Feb 2021 05:39:04 -0500 Received: from mx2.suse.de ([195.135.220.15]:44206 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229802AbhBOKjC (ORCPT ); Mon, 15 Feb 2021 05:39:02 -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 6C69FAC32; Mon, 15 Feb 2021 10:38:20 +0000 (UTC) Received: from localhost (brahms [local]) by brahms (OpenSMTPD) with ESMTPA id 3e5d9e0a; Mon, 15 Feb 2021 10:39:22 +0000 (UTC) From: Luis Henriques To: Amir Goldstein Cc: Greg KH , Jeff Layton , 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: Mon, 15 Feb 2021 10:39:22 +0000 In-Reply-To: (Amir Goldstein's message of "Mon, 15 Feb 2021 08:12:03 +0200") Message-ID: <87h7mdvcmd.fsf@suse.de> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Amir Goldstein writes: > On Fri, Feb 12, 2021 at 2:40 PM Luis Henriques wrote: ... >> 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); >> } >> > > Which kernel is this patch based on? It was v5.11-rc7. > At this point, I am with Dave and Darrick on not falling back to > generic_copy_file_range() at all. > > We do not have proof of any workload that benefits from it and the > above patch does not protect from a wierd use case of trying to copy a file > from sysfs to sysfs. > Ok, cool. I can post a new patch doing just that. I guess that function do_copy_file_range() can be dropped in that case. > I am indecisive about what should be done with generic_copy_file_range() > called as fallback from within filesystems. > > I think the wise choice is to not do the fallback in any case, but this is up > to the specific filesystem maintainers to decide. I see what you mean. You're suggesting to have userspace handle all the -EOPNOTSUPP and -EXDEV errors. Would you rather have a patch that also removes all the calls to generic_copy_file_range() function? And that function can also be deleted too, of course. Cheers, -- Luis