Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp9920476rwb; Thu, 24 Nov 2022 21:42:33 -0800 (PST) X-Google-Smtp-Source: AA0mqf6qw6WWwMS8tWy3P+w8ChQkhKuuQF2xP6s59ETMFGtC0l8C5B4Wqg5bpeMrNxOAy7VPpA4Z X-Received: by 2002:a17:906:4dc7:b0:76c:42b4:dea4 with SMTP id f7-20020a1709064dc700b0076c42b4dea4mr29736894ejw.515.1669354952915; Thu, 24 Nov 2022 21:42:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669354952; cv=none; d=google.com; s=arc-20160816; b=aBbv/QtcD58LX4LsCjQ8Ts+SK8luYctYCOn+OY2S4bcdcD180cm1YAKbBTrP380i+n TAcAp9KvoF3CRsuv9WDYKPUAF4uQwg/b7FkW5gi/1M6EPeoxovruUJ9S5cV2xpnlS3cu hB0e769CweSlTGA8uGcRs88tFJxPrB4C/kVzwOpPxzQGwzU8DKn4Js/K6uf5wzhagoHs +O9AfdFKAfzWKVHXso1pwWRFXKWmorClhwSIXy41ULhCpjm7C4KHV3ewKC9ahkMVJtMd L++M1w9XGT5UzqFONcHLGtw0N0+9gKUYfLcMh5XedmM0KPejNPkr6f5HdTGSb4Ex1GxT zDag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=/Fy8IK15qJEgUw8XxuI3itfGpmDfS+C65ciFIe4IOEs=; b=dS03T3GjF5+NFA6V7lh4O8cbgUYa3Q/XuVyURVGCvMxxwx0VQycuEm3xwNlTkbU3ej dAXka2slz+ssGGP4VfvB16Ru/eh8DqYPFQAa5aqmhWUv7TYmDv6bYqB53zgQaj4Oyezq 0KO21OzOfHt+u+rN5cHIT54upejcuAbHAFeKM16/sRA/18d/deJJcY2AcH3AzTgZGez8 362bU+BSwgRv0SjfCXf7fMH7Z4m0B9eoXMoLEhtxw7Y/2QCdCrp4MZpjVxFfPqoMkcYq W1cbkiOCNUB+S0wCV9Bz23ESRdaWb6233XBokYDEEMt3t3/HF7BigYXjhoMzomZZB1x2 qmuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b=DJkkcB9+; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zeniv.linux.org.uk Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v18-20020a1709061dd200b007ae0db0c454si1721755ejh.635.2022.11.24.21.41.57; Thu, 24 Nov 2022 21:42:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b=DJkkcB9+; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zeniv.linux.org.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229450AbiKYFgV (ORCPT + 99 others); Fri, 25 Nov 2022 00:36:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229529AbiKYFgU (ORCPT ); Fri, 25 Nov 2022 00:36:20 -0500 Received: from zeniv.linux.org.uk (zeniv.linux.org.uk [IPv6:2a03:a000:7:0:5054:ff:fe1c:15ff]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D524B1F2E2; Thu, 24 Nov 2022 21:36:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=/Fy8IK15qJEgUw8XxuI3itfGpmDfS+C65ciFIe4IOEs=; b=DJkkcB9+bPhlo5VEmHPEHPOJXO TYAZUlKV4rHswxZ0Cx6RrOzm0QRB9AOYhhnvj+b5UvoWy4ix+CpY09sDKezlqGCkSPSiueHH7XXXC VNLNgoPZAglozigfkez0BXchLSpnH3acekVgBZMcjI0gT6zexLKD0I8qLoX4tK5hb2e04mCm2aSkH Z8UkSY7YMcdZXhj28gpqcwE0sUJ7m2YrruZufQjF1Uk9rcFfu05mJ2GSAXpxG2+vq+EVHjS3jyTRk IRO/dPbSu5GRyT1c6fgEat+6jv1aY0UIT4Baux4543rh2UXCIChk3o7FIjm2hpfezf9PTZ/xeixEE xjX8k4SQ==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.96 #2 (Red Hat Linux)) id 1oyRNk-006bGd-1M; Fri, 25 Nov 2022 05:36:12 +0000 Date: Fri, 25 Nov 2022 05:36:12 +0000 From: Al Viro To: Amir Goldstein Cc: Linus Torvalds , Namjae Jeon , Luis Henriques , Olga Kornievskaia , Jan Kara , linux-fsdevel@vger.kernel.org, linux-cifs@vger.kernel.org, linux-nfs@vger.kernel.org, Luis Henriques Subject: Re: [PATCH v2] vfs: fix copy_file_range() averts filesystem freeze protection Message-ID: References: <20221117205249.1886336-1-amir73il@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221117205249.1886336-1-amir73il@gmail.com> Sender: Al Viro X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Thu, Nov 17, 2022 at 10:52:49PM +0200, Amir Goldstein wrote: > Commit 868f9f2f8e00 ("vfs: fix copy_file_range() regression in cross-fs > copies") removed fallback to generic_copy_file_range() for cross-fs > cases inside vfs_copy_file_range(). > > To preserve behavior of nfsd and ksmbd server-side-copy, the fallback to > generic_copy_file_range() was added in nfsd and ksmbd code, but that > call is missing sb_start_write(), fsnotify hooks and more. > > Ideally, nfsd and ksmbd would pass a flag to vfs_copy_file_range() that > will take care of the fallback, but that code would be subtle and we got > vfs_copy_file_range() logic wrong too many times already. > > Instead, add a flag to explicitly request vfs_copy_file_range() to > perform only generic_copy_file_range() and let nfsd and ksmbd use this > flag only in the fallback path. > > This choise keeps the logic changes to minimum in the non-nfsd/ksmbd code > paths to reduce the risk of further regressions. > > Fixes: 868f9f2f8e00 ("vfs: fix copy_file_range() regression in cross-fs copies") > Tested-by: Namjae Jeon > Tested-by: Luis Henriques > Signed-off-by: Amir Goldstein Applied...