Received: by 2002:a05:6358:701b:b0:131:369:b2a3 with SMTP id 27csp4605964rwo; Tue, 25 Jul 2023 08:23:53 -0700 (PDT) X-Google-Smtp-Source: APBJJlFHqY9T87cNVyd0t3eOSluv2nkh1sZQLtMJpiZ0oYNwgDYy4T/IhafBez2yH3Gm1vvLxDmW X-Received: by 2002:a19:674c:0:b0:4fb:8948:2b2b with SMTP id e12-20020a19674c000000b004fb89482b2bmr6898376lfj.48.1690298633085; Tue, 25 Jul 2023 08:23:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690298633; cv=none; d=google.com; s=arc-20160816; b=rjAngMUkighWgXLag0DKL5jFl0ewfHTkwHS3JlwbtUcgtQT2Q9suzW4hLzqUx8bWFO KCV6KxkKfYVJxWUFOKP9LR068zdImqq9TCL/VkZ9VM4EtQJwQpVOae/mDxV+vduPkQrP RWGzNF0A3GjEpz7frnNEZ4+lf7faQIbyPKEmDldiWN7oTndCZaTiPmk0aXerYm3xdDJl w4Z+lBO38yw8JhL2srcOrdkwPGpUwr+rvVKe44TL3pVZiF7hToUX1ev/m7T9xQtII2EX pzCaGgi7cPDndiEWeBsA+eBRxDyhn4ZeqnG4u+vKmFMh5uUeuEhI+25RPNP6aSwOEgIW D0RA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:dlp-filter:cms-type:user-agent :in-reply-to:mime-version:message-id:subject:cc:to:from:date :dkim-signature:dkim-filter; bh=h5fyAZXUQIbBcME9y0pgsagoVTcJ5iC8zePjjoLvhXA=; fh=s+EmPS+LlaMCAkb5PeC+4PPgmSm+U7ltMdsOQGEzK9g=; b=Qq9f5T6YTKSVYVTV8gSnftPyMJMSgZ0CvBS5BvMNSkyRWglfzJrNMjL2Bp3ZFPsbGJ p6BpDUzSmcFm8Eb9w4CS/WlpkogSw0o4TJ1Admd6Hopdu4nIwebv7KFJ/r/isyhDIelX 5HqHrbhMheOh/+X7I7OQfEjgqxeZbyqcavra+hARS90FIs3g0LcZBPga66jf/Vb0aAI9 jBSyHGstq/cut2xYdpkt/5Gibezw+XZFw6A9kxGCQN/SqCZElpgZcqG2Qc/T44Cl8FqN fZGcBSWmj12+Itxgjf9qaNuUpn9xPXlxbF+fKwFOGYrpS1l24aCxmMeSfTkK1mftuIqF 4OsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=aTQ4A1qQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g4-20020aa7c844000000b0051de49abbd2si8170059edt.483.2023.07.25.08.23.29; Tue, 25 Jul 2023 08:23:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=@samsung.com header.s=mail20170921 header.b=aTQ4A1qQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232888AbjGYPO2 (ORCPT + 99 others); Tue, 25 Jul 2023 11:14:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232792AbjGYPO0 (ORCPT ); Tue, 25 Jul 2023 11:14:26 -0400 Received: from mailout1.samsung.com (mailout1.samsung.com [203.254.224.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3BF2C1BE8 for ; Tue, 25 Jul 2023 08:14:24 -0700 (PDT) Received: from epcas5p1.samsung.com (unknown [182.195.41.39]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20230725151420epoutp018c2a4a8acdc4a3ab440dc3d7c80eb31a~1JSFljvXc0551205512epoutp01z for ; Tue, 25 Jul 2023 15:14:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20230725151420epoutp018c2a4a8acdc4a3ab440dc3d7c80eb31a~1JSFljvXc0551205512epoutp01z DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1690298060; bh=h5fyAZXUQIbBcME9y0pgsagoVTcJ5iC8zePjjoLvhXA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=aTQ4A1qQoyZ+ljNm0vSd7i6FTzM+qwzuhrP/wLImb1jkIKVLgOtgv1VVz0AwwlCnl RqgvkeohGiXr+YoowO8dz/66dk7nSk16RfFOXRVDYGpkKx190+xY+K99Lj7mENNBzr MZhrgO1cPwfgoBHjdeHbxb9cwpJCWdVbbTU5n0jw= Received: from epsnrtp2.localdomain (unknown [182.195.42.163]) by epcas5p2.samsung.com (KnoxPortal) with ESMTP id 20230725151419epcas5p2005fdd0636dd4bf95c98ce78f08ad014~1JSE5kcJc1555015550epcas5p2U; Tue, 25 Jul 2023 15:14:19 +0000 (GMT) Received: from epsmges5p3new.samsung.com (unknown [182.195.38.183]) by epsnrtp2.localdomain (Postfix) with ESMTP id 4R9LCt0frFz4x9Pt; Tue, 25 Jul 2023 15:14:18 +0000 (GMT) Received: from epcas5p2.samsung.com ( [182.195.41.40]) by epsmges5p3new.samsung.com (Symantec Messaging Gateway) with SMTP id 23.B0.06099.9C6EFB46; Wed, 26 Jul 2023 00:14:17 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas5p2.samsung.com (KnoxPortal) with ESMTPA id 20230725115145epcas5p2bdf4e5246908e9f8aceee980aa15264d~1GhNJP4CH0397103971epcas5p2x; Tue, 25 Jul 2023 11:51:45 +0000 (GMT) Received: from epsmgmcp1.samsung.com (unknown [182.195.42.82]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20230725115145epsmtrp28faf324b02c727aa3c518448fd58aec4~1GhNIkRXG0727807278epsmtrp2O; Tue, 25 Jul 2023 11:51:45 +0000 (GMT) X-AuditID: b6c32a4b-d308d700000017d3-22-64bfe6c9a7c8 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgmcp1.samsung.com (Symantec Messaging Gateway) with SMTP id EF.2A.64355.157BFB46; Tue, 25 Jul 2023 20:51:45 +0900 (KST) Received: from green245 (unknown [107.99.41.245]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20230725115143epsmtip21293061110efab61d2129f2fdfdd2417~1GhLsKbpe3138731387epsmtip2z; Tue, 25 Jul 2023 11:51:43 +0000 (GMT) Date: Tue, 25 Jul 2023 17:18:32 +0530 From: Nitesh Shetty To: Dave Chinner Cc: Christoph Hellwig , Alexander Viro , Christian Brauner , gost.dev@samsung.com, Anuj Gupta , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, nitheshshetty@gmail.com, anuj1072538@gmail.com Subject: Re: [PATCH] fs/read_write: Enable copy_file_range for block device. Message-ID: <20230725114832.7dratlqxomvw2bcf@green245> MIME-Version: 1.0 In-Reply-To: User-Agent: NeoMutt/20171215 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrCJsWRmVeSWpSXmKPExsWy7bCmhu7JZ/tTDG402Vh8/PqbxaJpwl9m i9eHPzFabDl2j9Hi5oGdTBYrVx9lstiz9ySLxeVdc9gsdjxpZLQ4//c4qwOXx6lFEh47Z91l 99i0qpPNY/fNBjaPvi2rGD0+b5Lz2PTkLVMAe1S2TUZqYkpqkUJqXnJ+SmZeuq2Sd3C8c7yp mYGhrqGlhbmSQl5ibqqtkotPgK5bZg7QeUoKZYk5pUChgMTiYiV9O5ui/NKSVIWM/OISW6XU gpScApMCveLE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WpSXmKPExsWy7bCSvG7g9v0pBqc/8Fh8/PqbxaJpwl9m i9eHPzFabDl2j9Hi5oGdTBYrVx9lstiz9ySLxeVdc9gsdjxpZLQ4//c4qwOXx6lFEh47Z91l 99i0qpPNY/fNBjaPvi2rGD0+b5Lz2PTkLVMAexSXTUpqTmZZapG+XQJXxoplB5gLlslX7J60 lL2BcZlkFyMnh4SAicTJFw9Yuhi5OIQEtjNKTGz8yg6RkJRY9vcIM4QtLLHy33N2iKInjBLr D0xgBUmwCKhKrP+xh62LkYODTUBb4vR/DpCwiICaxKRJO8B6mQWWMEnc+uYNYgsL+Ej0b5rC BGLzCphJtC/5BLW4kUli8bQeNoiEoMTJmU9YIJrNJOZtfsgMMp9ZQFpi+T+w+ZwCxhIHJ88C my8qICMxY+lX5gmMgrOQdM9C0j0LoXsBI/MqRtHUguLc9NzkAkO94sTc4tK8dL3k/NxNjOBY 0Qrawbhs/V+9Q4xMHIyHGCU4mJVEeA1j9qUI8aYkVlalFuXHF5XmpBYfYpTmYFES51XO6UwR EkhPLEnNTk0tSC2CyTJxcEo1MMWW79C1rFHYxffkb869mmdHNhV6yDYwm1RdLJJXX3U2bI9V kXLFp2miCwXmN7X+d+Aw5r8vVfq3KXLunk2XJDq2zTw97ZBQvJffOo4dVYq59uw+j99NUfRZ w7jxft6EfQYN+4R2fM0K4Vog/pHvRf2cvWVeHYpXfhvXujXoFR7h+rLV9bzx/I7a3zLs9U8z tP0/ffpXd9+ca/odv0l7WKykXobqH7h2W6VZtEbHq3qv/b98+2I+7oRbe0r0bSbPiEi5FBMl sGPxNO2btZbHGZkf9R0pmWMsn9tvUKjf4K0fvnfxN/+y2D2Lqx5O+iWR+Nl7kdV1jvs7w6ee rbl7vWO6gv3hyVJfstQuxkSZKLEUZyQaajEXFScCAM/Z58IEAwAA X-CMS-MailID: 20230725115145epcas5p2bdf4e5246908e9f8aceee980aa15264d X-Msg-Generator: CA Content-Type: multipart/mixed; boundary="----hN0RooYYa-ItG0rOrbcpG43nsRC9v5sOSsCeQA9.xTvcVY.j=_e53bc_" X-Sendblock-Type: REQ_APPROVE CMS-TYPE: 105P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20230724060655epcas5p24f21ce77480885c746b9b86d27585492 References: <20230724060336.8939-1-nj.shetty@samsung.com> <20230724163838.GB26430@lst.de> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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-kernel@vger.kernel.org ------hN0RooYYa-ItG0rOrbcpG43nsRC9v5sOSsCeQA9.xTvcVY.j=_e53bc_ Content-Type: text/plain; charset="utf-8"; format="flowed" Content-Disposition: inline Hi Dave, On 23/07/25 08:08AM, Dave Chinner wrote: >On Mon, Jul 24, 2023 at 06:38:38PM +0200, Christoph Hellwig wrote: >> > > Change generic_copy_file_checks to use ->f_mapping->host for both inode_in >> > > and inode_out. Allow block device in generic_file_rw_checks. >> > >> > Why? copy_file_range() is for copying a range of a regular file to >> > another regular file - why do we want to support block devices for >> > somethign that is clearly intended for copying data files? >> >> Nitesh has a series to add block layer copy offload, > >Yes, I know. > >> and uses that to >> implement copy_file_range on block device nodes, > >Yes, I know. > >> which seems like a >> sensible use case for copy_file_range on block device nodes, > >Except for the fact it's documented and implemented as for copying >data ranges of *regular files*. Block devices are not regular >files... > >There is nothing in this patchset that explains why this syscall >feature creep is desired, why it is the best solution, what benefits >it provides, how this new feature is discoverable, etc. It also does >not mention that user facing documentation needs to change, etc > Agreed. I missed adding context in description. >> and that >> series was hiding a change like this deep down in a "block" title >> patch, > >I know. > >> so I asked for it to be split out. It still really should >> be in that series, as there's very little point in changing this >> check without an actual implementation making use of it. > >And that's because it's the wrong way to be implementing block >device copy offloads. > >That patchset originally added ioctls to issue block copy offloads >to block devices from userspace - that's the way block device >specific functionality is generally added and I have no problems >with that. > We moved to copy_file_range, so that we can reuse the existing infra instead of adding another ioctl[1]. >However, when I originally suggested that the generic >copy_file_range() fallback path that filesystems use (i.e. >generic_copy_file_range()) should try to use the block copy offload >path before falling back to using splice to copy the data through >host memory, things went off the rails. > >That has turned into "copy_file_range() should support block devices >directly" and the ioctl interfaces were removed. The block copy >offload patchset still doesn't have a generic path for filesystems >to use this block copy offload. This is *not* what I originally >suggested, and provides none of the benefit to users that would come >from what I originally suggested. Block device copy offload is >largely useless to users if file data copies within a filesystem >don't make use of it - very few applications ever copy data directly >to/from block devices directly... > >So from a system level point of view, expanding copy_file_range() to >do direct block device data copies doesn't make any sense. Expanding >the existing copy_file_range() generic fallback to attempt block >copy offload (i.e. hardware accel) makes much more sense, and will >make copy_file_range() much more useful to users on filesystem like >ext4 that don't have reflink support... > Agreed. But adding all the cases is making the series heavier and harder to iterate. So we trimmed some of the patches and feature. Hopefully we can get to filesystems, if the current series gets in. >So, yeah, this patch, regardless of how it is presented, needs to a >whole lot more justification that "we want to do this" in the commit >message... > Agreed, the commit description was not conveying the things we wanted to do. It makes sense to send block related relaxation as part of copy offload series instead of doing it here. However, the change to get inode pointer using mapping_host is still independent and can go as a separate fix patch. Thank you, Nitesh Shetty [1] https://lore.kernel.org/all/Y3607N6lDRK6WU7%2F@T590/ ------hN0RooYYa-ItG0rOrbcpG43nsRC9v5sOSsCeQA9.xTvcVY.j=_e53bc_ Content-Type: text/plain; charset="utf-8" ------hN0RooYYa-ItG0rOrbcpG43nsRC9v5sOSsCeQA9.xTvcVY.j=_e53bc_--