Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp145311rwd; Fri, 19 May 2023 17:04:47 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7lUBjgg6tXojXe6cfDFVSrcPGC4uHGvXDNaT2YrIX14vhS23MRiM3/TzVhOitm/uDogsUd X-Received: by 2002:a17:902:da85:b0:1ab:19ff:3a20 with SMTP id j5-20020a170902da8500b001ab19ff3a20mr5050987plx.54.1684541087443; Fri, 19 May 2023 17:04:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684541087; cv=none; d=google.com; s=arc-20160816; b=OznCM/ZcdtG0MHe3sPlyHPyGFenNVtCR6SMBT6dnIRC5dxEPlbBmCp6LwHLCgZBey9 ttVEJzFxJDMTE9RZjVIsMg60Tzvw4b4TJ3IzlZ2X5Qo1NHscYrp61Xpyho46NizCGA96 QjvFtJogEj/sxufUneZFL/f3PM4QLqAPKbbpMgtZWcplRSXGgG8LhanPVQ8pNUtWIFNM EG4djWL9OYJ1PCKTX2DEQ9NUbSBn30pZPZZvr2jTb7laIlXYHv7wn3THPC0/wPuV7HBZ hjeaiU7WneWGAjiQekx/d5RjGLN0rMk1I2ys0+dhPBtWBiaOlV1NHKLr83JTB3sG6dPl gCuw== 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:date:subject:cc:to:from :dkim-signature; bh=gRzUovfXnw170GzVg3YWYDNx7Fcy6r2PjCbmCvJAFKQ=; b=Wh3XYsdIcfIZtqUNBrvOru4xHJELe0HofbG8LfCImRdoWSD5uNultRn9DphnJ2pjuC 9ZCdGlI/U2Cydw/0bftiOB1/CWR6btO1/+tYzHn/znLlqpIOO/3p0cQgNxUWFI6BCmng P4KFL5NKUYvo95ar1hLmbPXXGAzpQS2sXVDKK8Z8fb/yso3YUUNnkhIfVzwe52o2bygT 4CGkiJnUjHNgkSjuyiliABjN58pd6jgpS8/SIOYxKSSEVyi0wZsr00tPzPwMC7emSXG8 TYDxCFyK4uB6NbzuHD5HeBtNgv4H0dp72FJ3znN7ZG/JEq4NHDNdtZ4qSDhawre9Xatp nbtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="aC+/Iko3"; 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=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c9-20020a170902724900b001aadd02b88fsi336136pll.233.2023.05.19.17.04.34; Fri, 19 May 2023 17:04:47 -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=@redhat.com header.s=mimecast20190719 header.b="aC+/Iko3"; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231615AbjETADm (ORCPT + 99 others); Fri, 19 May 2023 20:03:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51492 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230415AbjETAD3 (ORCPT ); Fri, 19 May 2023 20:03:29 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4BBB61700 for ; Fri, 19 May 2023 17:01:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684540898; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gRzUovfXnw170GzVg3YWYDNx7Fcy6r2PjCbmCvJAFKQ=; b=aC+/Iko3Vq5u3rkqbApPKHsujONg5Tb7nnB0hK/XYGg1qGdZRU4HUnQ8b2hya3JC0hy32p 7WCBv0uwI0KMw1isivgybf3e8uyxBEWRPexPI4blmGKG0/L2WORwPW2qLV2Wb7dfAUFPt/ fgacPR7UC0HVeBjl+GY/Lz2ol0QmNCk= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-672-1JhP-Y78PWKPthfxNC2xdQ-1; Fri, 19 May 2023 20:01:35 -0400 X-MC-Unique: 1JhP-Y78PWKPthfxNC2xdQ-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4596E1C041B8; Sat, 20 May 2023 00:01:34 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.42.28.221]) by smtp.corp.redhat.com (Postfix) with ESMTP id B4E3740CFD48; Sat, 20 May 2023 00:01:31 +0000 (UTC) From: David Howells To: Jens Axboe , Al Viro , Christoph Hellwig Cc: David Howells , Matthew Wilcox , Jan Kara , Jeff Layton , David Hildenbrand , Jason Gunthorpe , Logan Gunthorpe , Hillf Danton , Christian Brauner , Linus Torvalds , linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Christoph Hellwig , netdev@vger.kernel.org Subject: [PATCH v21 13/30] net: Make sock_splice_read() use copy_splice_read() by default Date: Sat, 20 May 2023 01:00:32 +0100 Message-Id: <20230520000049.2226926-14-dhowells@redhat.com> In-Reply-To: <20230520000049.2226926-1-dhowells@redhat.com> References: <20230520000049.2226926-1-dhowells@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 Make sock_splice_read() use copy_splice_read() by default as file_splice_read() will return immediately with 0 as a socket has no pagecache and is a zero-size file. Signed-off-by: David Howells cc: "David S. Miller" cc: Eric Dumazet cc: Jakub Kicinski cc: Paolo Abeni cc: Christoph Hellwig cc: Al Viro cc: Jens Axboe cc: netdev@vger.kernel.org cc: linux-block@vger.kernel.org cc: linux-mm@kvack.org --- net/socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/socket.c b/net/socket.c index b7e01d0fe082..401778380195 100644 --- a/net/socket.c +++ b/net/socket.c @@ -1093,7 +1093,7 @@ static ssize_t sock_splice_read(struct file *file, loff_t *ppos, struct socket *sock = file->private_data; if (unlikely(!sock->ops->splice_read)) - return generic_file_splice_read(file, ppos, pipe, len, flags); + return copy_splice_read(file, ppos, pipe, len, flags); return sock->ops->splice_read(sock, ppos, pipe, len, flags); }