Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2886577pxb; Fri, 12 Feb 2021 04:08:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJz1VrZvNczrH2nM+FCf4RdCtJo3lqP3B0SqCL2uZVWzEu034IMuHQ78RUBqA1q09xR5fcBE X-Received: by 2002:a17:906:eca5:: with SMTP id qh5mr2589773ejb.161.1613131699072; Fri, 12 Feb 2021 04:08:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613131699; cv=none; d=google.com; s=arc-20160816; b=uhRsW23ki471RbUvsARpeb7ZHPJ61npdLZWQupqSAdlJ4ebTKHAIPOKcAceYx3hUIV eCPkRdLkdSjRTjF07C4plOIr7cLib5tow/1TLd8sboGqzP6fcFmNxk5EkN3EbjretgIP OkFQ82R3RADLK7cFupYZB7wWtcsMpO+XmBxn7MuApj7VlDI1iRlndBySJZvPsrIPcyuo QxQWv3a6IQcSc6qMp8E2XSdCnEe8J8N0P/BrXqFGp4jRZI0HOqbilv0IjPPik7Ct9oKR uSeFevdSEl5AQiNr64U+ZEDaHqj+nEf33Lgxx3tpBJ6e7jtpk+GZRQbMw4ol0Mnjhq5i mLuw== 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=uZQCK/QOUCYUVsD0K/1ukz3nMS3d4pfwFw1XRbLd1e4=; b=Zh+SYPcdb6N/ZJdP8oVfP06RgzZFM8B0e7As4lpwPENXNgoRMd6LO/1XV7NGPv6i9/ N945kv7IVieaGo8trGFX99s99PghIeaK1CJUYW46uUBxDIsQYq6P9K1FtNuprf2JlIyp 8emJna06KEQVJzs4RqFYdqWcCQ2+xZp77dsV1OpB668oATYGNS8CG0albAqavt4UD1X1 1O+sc0gcHtbiFi9de8wgvJ0UwzuD8Q9y7XSvaRK1CcDQjc+2/RjWO1viKQG6qr/wZxBr trncy3oNhLwaIAXsg3ItGnTDxf1tH12NYErqvQjIusIsU5u5mxDjgtZbDFEKWfCO+6zB 0cVg== 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 p31si8014410edb.114.2021.02.12.04.07.56; Fri, 12 Feb 2021 04:08:19 -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 S230291AbhBLME6 (ORCPT + 99 others); Fri, 12 Feb 2021 07:04:58 -0500 Received: from mx2.suse.de ([195.135.220.15]:52752 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229497AbhBLMEz (ORCPT ); Fri, 12 Feb 2021 07:04:55 -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 3D2A0AF49; Fri, 12 Feb 2021 12:04:13 +0000 (UTC) Received: from localhost (brahms [local]) by brahms (OpenSMTPD) with ESMTPA id c04de85f; Fri, 12 Feb 2021 12:05:14 +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> Date: Fri, 12 Feb 2021 12:05:14 +0000 In-Reply-To: (Greg KH's message of "Fri, 12 Feb 2021 09:39:18 +0100") Message-ID: <871rdljxtx.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 10:22:16AM +0200, Amir Goldstein wrote: >> On Fri, Feb 12, 2021 at 9:49 AM Greg KH wrote: >> > >> > On Fri, Feb 12, 2021 at 12:44:00PM +0800, Nicolas Boichat wrote: >> > > Filesystems such as procfs and sysfs generate their content at >> > > runtime. This implies the file sizes do not usually match the >> > > amount of data that can be read from the file, and that seeking >> > > may not work as intended. >> > > >> > > This will be useful to disallow copy_file_range with input files >> > > from such filesystems. >> > > >> > > Signed-off-by: Nicolas Boichat >> > > --- >> > > I first thought of adding a new field to struct file_operations, >> > > but that doesn't quite scale as every single file creation >> > > operation would need to be modified. >> > >> > Even so, you missed a load of filesystems in the kernel with this patch >> > series, what makes the ones you did mark here different from the >> > "internal" filesystems that you did not? >> > >> > This feels wrong, why is userspace suddenly breaking? What changed in >> > the kernel that caused this? Procfs has been around for a _very_ long >> > time :) >> >> That would be because of (v5.3): >> >> 5dae222a5ff0 vfs: allow copy_file_range to copy across devices >> >> The intention of this change (series) was to allow server side copy >> for nfs and cifs via copy_file_range(). >> This is mostly work by Dave Chinner that I picked up following requests >> from the NFS folks. >> >> But the above change also includes this generic change: >> >> - /* this could be relaxed once a method supports cross-fs copies */ >> - if (file_inode(file_in)->i_sb != file_inode(file_out)->i_sb) >> - return -EXDEV; >> - >> >> The change of behavior was documented in the commit message. >> It was also documented in: >> >> 88e75e2c5 copy_file_range.2: Kernel v5.3 updates >> >> I think our rationale for the generic change was: >> "Why not? What could go wrong? (TM)" >> I am not sure if any workload really gained something from this >> kernel cross-fs CFR. > > Why not put that check back? > >> In retrospect, I think it would have been safer to allow cross-fs CFR >> only to the filesystems that implement ->{copy,remap}_file_range()... > > Why not make this change? That seems easier and should fix this for > everyone, right? > >> 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. Cheers, -- Luis >> - Explicitly opt-out of CFR per-fs and/or per-file as Nicolas' patch does > > No. That way lies constant auditing and someone being "vigilant" for > the next 30+ years. Which will not happen. > > thanks, > > greg k-h