From patchwork Mon Oct 16 20:36:01 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: 153754 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp3711894vqb; Mon, 16 Oct 2023 13:37:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHYb7p6QuK4ywvpSlPeuO41lgKUgAXkvvJ6czpWm4I079moedZYboE4Gbqurs6yaHWiVHwc X-Received: by 2002:a17:902:f092:b0:1bb:ac37:384b with SMTP id p18-20020a170902f09200b001bbac37384bmr362934pla.6.1697488620871; Mon, 16 Oct 2023 13:37:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697488620; cv=none; d=google.com; s=arc-20160816; b=hqBYcnFhN8jTn8/pOz3HsZr3Xnxp0IAnaDm46sIhZUAR6Hi7zq+KN3vE0p4HsSOyS4 zKlKaLzYF3bBFhS6a5nElJGz9gtdMu8FFR5GWYds7VPrMjED1iYOj+QwK5WXkTRIN+6C JeXzYyo48QbK+B9Ll2dxpfpFk32GocSnuMJq5HFRwaOvml7jk5xAdkMurhCaXlsI3+qp RrgpkJ0LaH9M2Kf9JQi0JbMRhimQvc83AKgM4hM+U3WPrYriMz3LDXDs4yZogVq+aXM8 yjXOlYW+Z5MVd94SqU7NE6HVlKCHGZfbJqlaXdif0+IWVJ9KkCiwjsAu7Rj6uNh6tCs9 nE0g== 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=2BVd4gW1amvRoJvl5VvpLuR6Ry0NDgNbTlD5jg3Pjbs=; fh=Oskmylf92gQgoWcJVK2DZkdbYki3SlnV/gEzpmChMXQ=; b=mYvBH3nyp6RQX0Weo9voqUKAFafDWQZUsM6sCk1g2bWLOxZPcXeP8oQmE8KX+ynHBo a+Icd8ffVhZpUGmRjmhwJ0priBJEfeq7Nvjk+rCLaz+a5jochocnLA6ciWFsL/YOgM61 Bx9wMwUOtHDPJNibYHo9CpoHoo6qUUAvmvB0XAL1S+I/myMf2YaTPeqVDfWLhkPVnu9I YBvV7eNjnNXk+7FUEyTpKXNwMGZ9AycQzSKUHTJx8dz9xepOIj9YmexKyErCajo6nDOT aKOg+xne/BP2cI1VsHJs/XqpcYVbm6owuQ7UrNFFSDV3uLH0wLqK+UkwZdutw8qE8Bcz k9wQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nabijaczleweli.xyz header.s=202305 header.b=C1tqd1IU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id t4-20020a170902e84400b001c77674ea97si97777plg.423.2023.10.16.13.36.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 13:37:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@nabijaczleweli.xyz header.s=202305 header.b=C1tqd1IU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 24C4380BCBB5; Mon, 16 Oct 2023 13:36:58 -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 S234255AbjJPUgi (ORCPT + 18 others); Mon, 16 Oct 2023 16:36:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52848 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234308AbjJPUgS (ORCPT ); Mon, 16 Oct 2023 16:36:18 -0400 Received: from tarta.nabijaczleweli.xyz (tarta.nabijaczleweli.xyz [139.28.40.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 01D7119B; Mon, 16 Oct 2023 13:36:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nabijaczleweli.xyz; s=202305; t=1697488561; bh=GkcnvUcVpOCe5CAn1FqxU2g9Mal7SpC32VFF9WWd900=; h=Date:From:Cc:Subject:References:In-Reply-To:From; b=C1tqd1IUfTUwcsTencFYK4ZinxRZ0QuZ2dZaoE4ARNPRyq9gW9vWpdT8w5ibyI9IO r/FM5jS6XvZd94ewaBp3MmdkRCL01YlZZssVYT41RzBlOUuSwQmqV+o25Ai1oqf73g whBgvc+ZQIe1ix40Z7jL4XY9W38v3Z3RqOdHieeMFPqJmKEnGktgj7gqgPU8eFoxmn IucbGc2OFlHummOanDb/K4JlQDjB2Lrog6jG0eHqeDRjXWJq25q7gLNGnW7fC69FOK cZaaNZmMMW+ARrhcgZtdy2gtZEiAZ/iNRHUwVcZRPlnB2HWc4b5sja3KX4egmRmtL5 DhT5tHfmd/Wsg== Received: from tarta.nabijaczleweli.xyz (unknown [192.168.1.250]) by tarta.nabijaczleweli.xyz (Postfix) with ESMTPSA id 6EDA4FAF2; Mon, 16 Oct 2023 22:36:01 +0200 (CEST) Date: Mon, 16 Oct 2023 22:36:01 +0200 From: Ahelenia =?utf-8?q?Ziemia=C5=84ska?= Cc: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 11/11] splice: splice_to_socket: always request MSG_DONTWAIT Message-ID: <813e1805aa942862d300bec4d0563c5a466dce78.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:58 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779945827906504267 X-GMAIL-MSGID: 1779945827906504267 Otherwise we risk sleeping with the pipe locked for indeterminate lengths of time. Signed-off-by: Ahelenia ZiemiaƄska --- fs/splice.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/fs/splice.c b/fs/splice.c index 81788bf7daa1..d5885032f9a8 100644 --- a/fs/splice.c +++ b/fs/splice.c @@ -869,13 +869,11 @@ ssize_t splice_to_socket(struct pipe_inode_info *pipe, struct file *out, if (!bc) break; - msg.msg_flags = MSG_SPLICE_PAGES; + msg.msg_flags = MSG_SPLICE_PAGES | MSG_DONTWAIT; if (flags & SPLICE_F_MORE) msg.msg_flags |= MSG_MORE; if (remain && pipe_occupancy(pipe->head, tail) > 0) msg.msg_flags |= MSG_MORE; - if (out->f_flags & O_NONBLOCK) - msg.msg_flags |= MSG_DONTWAIT; iov_iter_bvec(&msg.msg_iter, ITER_SOURCE, bvec, bc, len - remain);