From patchwork Mon Oct 16 20:35:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ahelenia_Ziemia=C5=84ska?= X-Patchwork-Id: 153747 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp3711663vqb; Mon, 16 Oct 2023 13:36:25 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHmFS1IF63/TKi2TiYMnr1lvxNYHSw8iUmaKwyDLk7S/Kg9ZyqJKWPQdOY6FkHoWFSiRSOF X-Received: by 2002:a05:6358:9fa2:b0:166:d93c:1c47 with SMTP id fy34-20020a0563589fa200b00166d93c1c47mr390002rwb.0.1697488585505; Mon, 16 Oct 2023 13:36:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697488585; cv=none; d=google.com; s=arc-20160816; b=ijYd1Vh9CpvgMaEHE8S7Hzsi7Y6qPwYdUk6rwzYhkFrR0K6htd38IjnMGgisvz7Zk8 JkJh6arpTA3PmhDsZ5IWFnFzP2nFJF9UEAqNQnqUud4iVE5HLjXPTUFqzsz9NPT95KQf +gI9+LSknSJowdrnRf5kAfHKT6qv3IfPyMs084o3mvewlScPaQbVmRUmCZ9ZDUkfpmvB 4jRvzhn4XR7MYuddr7Qb6u5+euchskesXpJZcbuvtCz60/MO1mn6xeKLaa45h5rxsU1E rjl7sbNjJtgwwOIc7yM0y/75QfYNeJppI8p7aB0iG1n/3Bv0IP4lViwL+0v3ClOH/Nxh 85fQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:from:date :dkim-signature; bh=SRefprY6yJ5tR72xexTgLZXUPYS4P+5XsrKDsPMLGUM=; fh=f6HFdZcA60n/XG/EpAejijSP9wEAg+RXoH4FMOyV+cI=; b=I8GIFlpIQ5ACIGw1Ts07ihDj6GvVHC+5uMWif8dG9TfsU9zXB/zOYsVruESjB9ymYm 5F+Udx6NtgxqJDvx4gRPZ0MzOY9jh8tNTwYOUVfxHpjPHZT3LfbVXQdu11O7ruXD1WHO b5KW1G4G+ZdZtN6uMrQpFXkIFwqX4bN9SyW3cZjlQEHd1ph/Bw9f0AqTX+0Cu1QQLiaD IPMy5C3tQjYTkUzEdZfFiGlVQfdddt49g0g+VI9btrhnM54MmnG7rSW4LmML/GXyFWMA 9kQbA5G77Fv7BpLHALTo+AtSiwRtYmFoTAjRzoyCeJRZ6UYm2ENsTcaAfOAKA/MZEm5L LRdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nabijaczleweli.xyz header.s=202305 header.b=GWQMVXQZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nabijaczleweli.xyz Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id a129-20020a624d87000000b006b864485166si544141pfb.146.2023.10.16.13.36.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 13:36:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@nabijaczleweli.xyz header.s=202305 header.b=GWQMVXQZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nabijaczleweli.xyz Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 27B0680BCBA5; Mon, 16 Oct 2023 13:36:20 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234181AbjJPUfv (ORCPT + 18 others); Mon, 16 Oct 2023 16:35:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56642 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233732AbjJPUfo (ORCPT ); Mon, 16 Oct 2023 16:35:44 -0400 Received: from tarta.nabijaczleweli.xyz (tarta.nabijaczleweli.xyz [139.28.40.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BF85CEE; Mon, 16 Oct 2023 13:35:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nabijaczleweli.xyz; s=202305; t=1697488539; bh=QIdiucrS3GrnXntvusWAnMhQFbLIMZWpsYTEgA0oZvk=; h=Date:From:Cc:Subject:References:In-Reply-To:From; b=GWQMVXQZ7y/HbCSGTSv83Wr3yTwhc+socxhzXVipZsxtx0T8JcxosbyMpIp3Lf8z7 JGKoumBA2EtRQkMukTFZR1ov6HnSh6vAOMfSSX8Qv3NG3x0SzdEfL6op9BJRNlrdit 8AE/gWj3NaT4wXWPw6kLwuuTLlvYsWwsqJPB4zMV8Ip+Gi8BNEAOdGvGp8rwKnnHXn fIUROjStWO6J0jfFr/Y5Z/t9Pl4LzAySsoxK597OsUEHrgCxdr3Eao51iJp55Bdz4J GF+q0YcnRS+Wrlqvkd6H9r/Figdls5+HeYs79FtkCRMTC4O7V3jlWQmzwQZRwL22hs GwkNuU8yyzSjQ== Received: from tarta.nabijaczleweli.xyz (unknown [192.168.1.250]) by tarta.nabijaczleweli.xyz (Postfix) with ESMTPSA id D38D610408; Mon, 16 Oct 2023 22:35:39 +0200 (CEST) Date: Mon, 16 Oct 2023 22:35:39 +0200 From: Ahelenia =?utf-8?q?Ziemia=C5=84ska?= Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Kuniyuki Iwashima , David Howells , Alexander Mikhalitsyn , Kirill Tkhai , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 02/11] af_unix: unix_stream_splice_read: always request MSG_DONTWAIT Message-ID: <8db45d00902da22ae25aa16a0c28bb41002fc039.1697486714.git.nabijaczleweli@nabijaczleweli.xyz> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20231006 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Mon, 16 Oct 2023 13:36:20 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779945791184450762 X-GMAIL-MSGID: 1779945791184450762 Otherwise we risk sleeping with the pipe locked for indeterminate lengths of time. Link: https://lore.kernel.org/linux-fsdevel/qk6hjuam54khlaikf2ssom6custxf5is2ekkaequf4hvode3ls@zgf7j5j4ubvw/t/#u Signed-off-by: Ahelenia ZiemiaƄska --- net/unix/af_unix.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c index 3e8a04a13668..9489b9bda753 100644 --- a/net/unix/af_unix.c +++ b/net/unix/af_unix.c @@ -2889,15 +2889,12 @@ static ssize_t unix_stream_splice_read(struct socket *sock, loff_t *ppos, .pipe = pipe, .size = size, .splice_flags = flags, + .flags = MSG_DONTWAIT, }; if (unlikely(*ppos)) return -ESPIPE; - if (sock->file->f_flags & O_NONBLOCK || - flags & SPLICE_F_NONBLOCK) - state.flags = MSG_DONTWAIT; - return unix_stream_read_generic(&state, false); }