Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp308154rwd; Fri, 26 May 2023 20:31:46 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ664dATEky1xWx46e4Zxj3bha4eGC+mNg4X871orWumICDayU2qgDazO5JWBdKKE4LVRPWN X-Received: by 2002:a05:6a00:1486:b0:647:b6c9:179d with SMTP id v6-20020a056a00148600b00647b6c9179dmr7369230pfu.21.1685158305997; Fri, 26 May 2023 20:31:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685158305; cv=none; d=google.com; s=arc-20160816; b=soG2TNfBuwRAf457oIFnVZ7vsXW9qdCttAefssmCJl5ETq4bmrxD6P0JL+6gngkmwY Ra3wNvt7ESRUNNbR+MKrqKJB/V3ZHeFJpovpu6ZkFn1/TXgMKjHWvqqp6iDk7WcaFyO/ XmYPKD6vXejvzJfp6hoNB7/qzuD/m5fUkjkA/LOIAL0QbFN44USgXye/tO7wCsJRBScL PXbprusfsk7LKS9GOzaovUs5KzmOAavORxRm7HuXUytfLWnVl/c8504QFiuhygrF6hc1 kK+Zv59Mm7K05TCEv/s2j24E4BghBv4RtB5CRCmMCZEGiyPt5/kSY1qlmalXLMFCn53d 9MAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=wezVkIyCeUXLLE0y0uliwOiTCg2myAhZxtLR7MUSmEw=; b=g6e5mau/8jOZI/4ET79OlLhXGdJGXp6hG5f9bWB9ndrT2UF5oe8022CmFRTvA1cAiA co3Cc+EvClir3N8HEfZc9uumH9kvQ/WFjzmpsAeBIq8s2oqU4hx28Y6Vdd1OcwEwdeF5 kluQaj1h5xKQ0GMoY9RWvJ69ZPaPgA/stuh5i8kbBjYAIQzatPRvQZftm/49gGgNWQTs yQkumE4KTj4j1/sLww43Z22CEIJLKoIxZ4f42gAmYf+7vZz5p25Qmm7ewNzuvYizmzzK g3TOBONRyPOUY1RNnWlVGZU+xKJeCqb7jztpCKG1eScV8tXNhW7a/ee3oshdKg5SwNhc G6Zg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=t3dIWnQN; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i9-20020aa796e9000000b0064cecf7b983si5421531pfq.143.2023.05.26.20.31.31; Fri, 26 May 2023 20:31:45 -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=@kernel.org header.s=k20201202 header.b=t3dIWnQN; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231433AbjE0DMI (ORCPT + 99 others); Fri, 26 May 2023 23:12:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229691AbjE0DMG (ORCPT ); Fri, 26 May 2023 23:12:06 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2FFBEE1 for ; Fri, 26 May 2023 20:12:05 -0700 (PDT) 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 dfw.source.kernel.org (Postfix) with ESMTPS id B94AB60E9C for ; Sat, 27 May 2023 03:12:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 83E27C433EF; Sat, 27 May 2023 03:12:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1685157124; bh=LJQ/LuDu59EMiwcWT0lcrMyGH/81VTyAMGBUL/u1fKA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=t3dIWnQNEST7MNFSz4icE8NVqDhbPpHnw8eb4RXLNyS9UTdk7URq350RkrKZt+tXp woikm0rkQ0G1YHfk/zPYUNd68o5tAoJttofuqbjod8mcLvwxmoH0wUUmlg/jFe2bR9 0ltAzLHQRdpEZf1DYtdB1RUp/xsvLwj/SGx2+GWt3EN33Tz0X5zluYdcinHH4MI8M9 FN47eZfNVpSSLZW3hdESDHnGb7SIoU7Hstiyb2JHk+ohE6m0g5lgTlpVItUEwOIpex kYXmc2AdjUVacPlwo4POLe0UPLlg/T2hngINzf0e65/lP3ec+0gH7QMJdFyEPI/xEv Lf5AYVSqtOc0w== Date: Fri, 26 May 2023 20:12:02 -0700 From: Jakub Kicinski To: David Howells Cc: netdev@vger.kernel.org, "David S. Miller" , Eric Dumazet , Paolo Abeni , Willem de Bruijn , David Ahern , Matthew Wilcox , Jens Axboe , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Tom Herbert , Tom Herbert Subject: Re: [PATCH net-next 3/4] kcm: Support MSG_SPLICE_PAGES Message-ID: <20230526201202.1cd35fe9@kernel.org> In-Reply-To: <20230524144923.3623536-4-dhowells@redhat.com> References: <20230524144923.3623536-1-dhowells@redhat.com> <20230524144923.3623536-4-dhowells@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 On Wed, 24 May 2023 15:49:22 +0100 David Howells wrote: > + err = skb_splice_from_iter(skb, &msg->msg_iter, copy, > + sk->sk_allocation); > + if (err < 0) { > + if (err == -EMSGSIZE) > + goto wait_for_memory; > + goto out_error; > + } > should there be a: copy = err; or: copy -= msg_data_left(msg); or some such here? Can we safely assume that skb_splice_from_iter() will copy all or nothing? > - err = skb_copy_to_page_nocache(sk, &msg->msg_iter, skb, > - pfrag->page, > - pfrag->offset, > - copy); > - if (err) > - goto out_error; > + skb_shinfo(skb)->flags |= SKBFL_SHARED_FRAG;