Received: by 2002:a05:6358:701b:b0:131:369:b2a3 with SMTP id 27csp2973824rwo; Mon, 24 Jul 2023 04:31:46 -0700 (PDT) X-Google-Smtp-Source: APBJJlFN/jlwqlcms4EhEluAx0OG8IX1cGR3i/GuWBW8aPaxulmzSHHLoJW9LDNijYP1W5m41iER X-Received: by 2002:a17:902:d50e:b0:1b1:ae33:30de with SMTP id b14-20020a170902d50e00b001b1ae3330demr11147867plg.13.1690198306123; Mon, 24 Jul 2023 04:31:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690198306; cv=none; d=google.com; s=arc-20160816; b=nS69BLvXsPz38mH/78MxOhTtMlRqXAiUHDpS20Rz95aB2LvzKTj5smOZ4skBzRjRjh ILPjfFIpLLB/xUanKWvvAJ1EjIBObqBdN6pVPvco3gcL6gSk7tMTOZZnqqIuM6wDFrzg vA69bXdGFjFT2/nQMIU3H2s/ozwxD2ux4I9nl21cX9CaYnu9w+Plni49bqsSxd+TZEI0 3J2xA7KlZrIQQ1lnpjNaSNLqxg301qt9nZUfQ9cK1u3CSK53kdruMlb4bcaO6Zck4LAH QWl79WmqfJoKaPHsA3XSBAbB+Bf3f1dpZ5v4mSZfqNAdKErnR9IJYNVRp3x2mPu+7Ebd YUPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:content-id:mime-version:subject :cc:to:references:in-reply-to:from:organization:dkim-signature; bh=XJJqbAsGZ2ehnnTZu14c2K+SnyqCmDMTRhvoD60EmdU=; fh=H+LtVjnOq6EsSyKxGFiqAE/nOtnQa95DgY19qjzreC4=; b=kfBLgiZfL6lhnF+nI6A9Nrt8Y0wGzfpPDSPB7/sIGqXloUgPUd4YF2RpwFzIZNwQf+ bqZgNWG6nL1n1HusaJ8SkNdesSeWZc/z99fPvF7ijG9qXKc0UWtaQHavjkKay6Sg+lGg QPFv+owK86kkwsijdb1Kju0lWffNZCzCXYtoXkKv/ukBpV5dua2uQgAjGObXKjJi1wjp RwjnpL8cPOekp0xuttLvw5e4A9Wz4q8ZLlmR2leLmpii3jxI1dcJ5nmmBlQ+tvztbdU8 4DjcMJ/UKtPmvITkCYwF63Eqg7HmIe/QNXZMXcIrOr7WsEHaqYmTJv/TRLGVn/XvG1ta p1dQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Y8rrTPVj; 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 y7-20020a17090322c700b001b3c66afaaesi9526761plg.185.2023.07.24.04.31.34; Mon, 24 Jul 2023 04:31:46 -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=Y8rrTPVj; 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 S230007AbjGXKVU (ORCPT + 99 others); Mon, 24 Jul 2023 06:21:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232600AbjGXKUr (ORCPT ); Mon, 24 Jul 2023 06:20:47 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9413A5BA2 for ; Mon, 24 Jul 2023 03:12:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1690193538; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=XJJqbAsGZ2ehnnTZu14c2K+SnyqCmDMTRhvoD60EmdU=; b=Y8rrTPVjojxIg8kAziE0JfJXpCEqjY3OEp74qcz8iKD+OmfuwC/P7vggTm89KCNGrePedK Y4bVC8HENQRQBYLX1Scg7/H+PZqHPC19kpt+jh+dxn5x3EKrlb7EF+ojc6b/+9S3o0rJR/ 7gVR5Ra0yUFS0Jfh/eVz1sVCcX+xUeU= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-9-b8po-l80PvyskH4PwWe_jA-1; Mon, 24 Jul 2023 06:12:14 -0400 X-MC-Unique: b8po-l80PvyskH4PwWe_jA-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 930D7185A793; Mon, 24 Jul 2023 10:12:13 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.42.28.116]) by smtp.corp.redhat.com (Postfix) with ESMTP id C0FA240BB42; Mon, 24 Jul 2023 10:12:12 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: <7854000d2ce5ac32b75782a7c4574f25a11b573d.1689757133.git.jstancek@redhat.com> References: <7854000d2ce5ac32b75782a7c4574f25a11b573d.1689757133.git.jstancek@redhat.com> To: Jan Stancek Cc: dhowells@redhat.com, kuba@kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, brauner@kernel.org, viro@zeniv.linux.org.uk Subject: Re: [PATCH] splice, net: Fix splice_to_socket() for O_NONBLOCK socket MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <64433.1690193532.1@warthog.procyon.org.uk> Date: Mon, 24 Jul 2023 11:12:12 +0100 Message-ID: <64434.1690193532@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 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_H4,RCVD_IN_MSPIKE_WL,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 Jan Stancek wrote: > LTP sendfile07 [1], which expects sendfile() to return EAGAIN when > transferring data from regular file to a "full" O_NONBLOCK socket, > started failing after commit 2dc334f1a63a ("splice, net: Use > sendmsg(MSG_SPLICE_PAGES) rather than ->sendpage()"). > sendfile() no longer immediately returns, but now blocks. > > Removed sock_sendpage() handled this case by setting a MSG_DONTWAIT > flag, fix new splice_to_socket() to do the same for O_NONBLOCK sockets. Does this actually work correctly in all circumstances? The problem might come if you have a splice from a non-rewindable source through a temporary pipe (eg. sendfile() using splice_direct_to_actor()). David