Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2244845rwb; Fri, 11 Nov 2022 07:00:43 -0800 (PST) X-Google-Smtp-Source: AA0mqf4V9SQ2Kl23xthJSCpTjyhGWtbmR9lAd/ioqmhYJNof9AYJRab1VbiCgJv0n71Dtg0aZ4vv X-Received: by 2002:a17:906:27cc:b0:7ad:f165:70c7 with SMTP id k12-20020a17090627cc00b007adf16570c7mr2083224ejc.503.1668178842979; Fri, 11 Nov 2022 07:00:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668178842; cv=none; d=google.com; s=arc-20160816; b=ojMlieYBUGtq/6Yq4P5SzDkKPX298oWKbkKwyFXpXjnTv4l2V8X7zRwtSx4cKSacUC QSUbUhXlPcdBtHp7l02OGD5JKNwYuvxlioejivETQTgDwHs/eLFZI/RosVdrNOCQ+c/8 kJvI0JJ87NqgoJo/xdRkwA2NLgq7lVycp99ksXHjkutwndOvtui/4wm06MWAF/sFxDtF NaOF9nSw5NBplFh0jgV5ppg3X/VEJqpBI5redlJNm/YUpJJkReUE9r8XCX/1aKvIxPdX GIfCbYCrxiMnF9GJ9640Ru1m0J/YfXNmrYS8KyExUnNN4RFdGgt+IBte+RREoI8XWHrW O7iQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:references :in-reply-to:mime-version:dkim-signature; bh=WGPrvryZfOFC3wzVBHxzozHV97DRR/WI/YY1vZ/2/qE=; b=rWsK6Iz7p+w5aJIeOKl+3oCppxcNiKzE5WMdQlHuQJYpXbUfAxp1f+Je9010Vb88+T YZLlSc5y8ENBLISP2J8GeX0/Doo/kBO3nqgYp25e3PPaQTx0tDAimH9VX71PPrw8hlnf 2etVOu9mEiPxpCE2KhZ4NWd+ZrrRhsf2PImedosksR7fAlAZr8o/nBSoxnwNqziG6sly JE2ccicQfePgCy/4KUwWJtrez9e2Oz5uXUwshSM2Yd2cuzF3lVDF+Ct64NJ7MDv1tqf+ K3i4kpQ7zqe1Spoa0cz5TS/FfL3bX+bPFGxMCw9He61dVGjVlP30rX/I3WbqDkhSdn7u W/PQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=EoNlpBMN; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sh32-20020a1709076ea000b007adbe7695a5si2378942ejc.935.2022.11.11.07.00.16; Fri, 11 Nov 2022 07:00:42 -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=@kernel.org header.s=k20201202 header.b=EoNlpBMN; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233776AbiKKOxQ (ORCPT + 99 others); Fri, 11 Nov 2022 09:53:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56906 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233967AbiKKOxO (ORCPT ); Fri, 11 Nov 2022 09:53:14 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E71B35E9E5; Fri, 11 Nov 2022 06:53:12 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 2F6BEB8262D; Fri, 11 Nov 2022 14:53:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AC919C433D6; Fri, 11 Nov 2022 14:53:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668178389; bh=WGPrvryZfOFC3wzVBHxzozHV97DRR/WI/YY1vZ/2/qE=; h=In-Reply-To:References:From:Date:Subject:To:Cc:From; b=EoNlpBMNR1ejsTCtegykgDZlopZro00NIke6A2KclFEqsmSdnfH+ul/G/mMGQgvaD Cbd4ng3JRSeDL7S7/wrTgoTTf3nXutv2+6gUlR8CZbWnfm26pdLK5YaJ/BLwVPE//0 6i1xJD4nA46ZkJ72rfMGU6QkgSbUAsDQruNsTbSLZnGfVKhCrZifT6cp4cTNJvjW4s 9nH/QMKqatRhijj7R2P8oQt6EbuJU9vcaKVvCZKEgHEkfZS+3CQHSOvBQkUWIBuWRs M5CSt894nfvGqdFLVMYrtX4cvqgjOspX3EMTmkNRbncYFpE6otDOvPIrFd1186KKKL 8i8ABK+aeOxtg== Received: by mail-oa1-f47.google.com with SMTP id 586e51a60fabf-12c8312131fso5651905fac.4; Fri, 11 Nov 2022 06:53:09 -0800 (PST) X-Gm-Message-State: ANoB5pmSkGN1ZlbttgRIUpBoPoVx9aOfj+XihP+U7Pj0u/qYpNvac1pU TEuU9X0FH4FPtQp0MM01f7k7Wb7OnRnTeTK7xBs= X-Received: by 2002:a05:6870:5882:b0:13d:5167:43e3 with SMTP id be2-20020a056870588200b0013d516743e3mr1081624oab.257.1668178388804; Fri, 11 Nov 2022 06:53:08 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a05:6839:1a4e:0:0:0:0 with HTTP; Fri, 11 Nov 2022 06:53:08 -0800 (PST) In-Reply-To: <20221110155522.556225-1-amir73il@gmail.com> References: <20221110155522.556225-1-amir73il@gmail.com> From: Namjae Jeon Date: Fri, 11 Nov 2022 23:53:08 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] vfs: fix copy_file_range() averts filesystem freeze protection To: Amir Goldstein Cc: Al Viro , Linus Torvalds , Olga Kornievskaia , Luis Henriques , linux-fsdevel@vger.kernel.org, linux-cifs@vger.kernel.org, linux-nfs@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 2022-11-11 0:55 GMT+09:00, Amir Goldstein : > 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") > Signed-off-by: Amir Goldstein > --- > > Hi Al, > > Another fix for the long tradition of copy_file_range() regressions. > This one only affected cross-fs server-side-copy from nfsd/ksmbd. > > I ran the copy_range fstests group on ext4/xfs/overlay to verify no > regressions in local fs and nfsv3/nfsv4 to test server-side-copy. > > I also patched copy_file_range() to test the nfsd fallback code on > local fs. > > Namje, could you please test ksmbd. Works fine. You can add tested-by tag for ksmbd. Tested-by: Namjae Jeon > > Thanks, > Amir.