Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp6196699rdb; Thu, 14 Dec 2023 10:47:04 -0800 (PST) X-Google-Smtp-Source: AGHT+IGvJGgmln4rdmIxbUiGmEu0FODGJhdCBASszysXHt+j6hKsfRHaZQ1edFXvB78Zie9k1UAf X-Received: by 2002:a05:6a00:2389:b0:6ce:2732:593 with SMTP id f9-20020a056a00238900b006ce27320593mr11489967pfc.68.1702579624159; Thu, 14 Dec 2023 10:47:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702579624; cv=none; d=google.com; s=arc-20160816; b=pD+tpJQA2ZAf42Cx8tfR9BZ8qj8aMr+dJBp2vpXn+1jBzOs0z3E4BTzi9WrHaPcMOI PJPvOyDTfG5hQYmkf0rWegWHBz3/a1QvuSnSUvIb92ND5pWzxbV5hSu96UzMZv/P0Hjh r2eBR987di/Xu9cf+Asn8LyUzSKGFb8YToyCVkapb5gFcAYiM+u5+FFwBIprcKkpMsTj B33klu3IwD/TWVxP+xMSnSDN7Kn895ndQZ9eiAa1RNo1f+HcGJIbSAWzSgWbpoz0f0hE 1MzdmvQbh/A+Sx88kNBet8R6EOPGoYS1NdK10CDH6KqXPXFMdSQOxLqD18zOOZbNgHZL 5q/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:in-reply-to:content-disposition:mime-version :references:user-agent:message-id:subject:cc:from:date :dkim-signature; bh=Pw8KuGCJLIC1bCiDHRlm89O3tIonmI8iK6z1vCXpiOk=; fh=K2Fdpt+HjY8vX9948rIe3SXncCNu97hhpRc/Melz/5o=; b=ddtJ50dsXychjPvu46aH+VyfiJGmQlhqF1D7qdFK96W6qSGjZRC8NusEUu11ukRUlF UAzuZPkXVORm7GT+WertQonHgthm8TIbHNfrb/QpNWkk9oLtv6Yr6tIWWQysM6OvXU3L NaMdRbf+d17lzg76bwg+8J4seZtiAo/6tVARF8TyRmDTaplbEwMqgM8KSu1ouZ2qJpfm 5uAvnGgdCHz12SGCEZON5JuI0cgK5eRK+vqEKgPX3uUs+Y8aoCSOEOy24fvvVqUZYelL rC+TALyEvWT5gVNzd33bl3Ar98LIUpeEuyte8uqjm5n8hJx4nRm0fv0yZk+cKBD+lpT2 +3/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nabijaczleweli.xyz header.s=202305 header.b=P8ju0Sm3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nabijaczleweli.xyz Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id h18-20020a056a00231200b006cdfbccebc5si11593785pfh.316.2023.12.14.10.47.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 10:47:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@nabijaczleweli.xyz header.s=202305 header.b=P8ju0Sm3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (Postfix) with ESMTP id E092A80A136F; Thu, 14 Dec 2023 10:45:22 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1573229AbjLNSo6 (ORCPT + 99 others); Thu, 14 Dec 2023 13:44:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1573174AbjLNSoy (ORCPT ); Thu, 14 Dec 2023 13:44:54 -0500 Received: from tarta.nabijaczleweli.xyz (tarta.nabijaczleweli.xyz [139.28.40.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7665211B; Thu, 14 Dec 2023 10:45:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nabijaczleweli.xyz; s=202305; t=1702579499; bh=4qtvhPDlYFbeuPt4vePPlt5K1o3kkOZ+MBZGGwh+FFM=; h=Date:From:Cc:Subject:References:In-Reply-To:From; b=P8ju0Sm3OMvOZtPNljKQPhXSyQMlfHEJtE98CO/ic0Ajw5eV+TDkGU0YSWCngB/rj aeenL8AE0EG/+c6NzgDJDM7uPl97/ipRZkB7IvpMSpOmcnwwGnrNrJcQEGp0heUAXz o5ivTEijg31QE7i9ynBuWG4JMqL/FLed/yHTx5oK6WwATt+jX1RqgmkYVrTZdPk5DW 2eHWCzVFfqO1a9ixMZlRCg8Hk/GegPSxe6S81hvwtpxW4Np6ZdLYQclS2jwoM+rk0Y 0diEBSA2uBsuSrKDe2CovEV9xHqdutsxMVtvPPPcnQ+C0nkfzgONxkxWz69Dmt8CIr O/u7/8m+IR5Nw== Received: from tarta.nabijaczleweli.xyz (unknown [192.168.1.250]) by tarta.nabijaczleweli.xyz (Postfix) with ESMTPSA id 2811613792; Thu, 14 Dec 2023 19:44:59 +0100 (CET) Date: Thu, 14 Dec 2023 19:44:59 +0100 From: Ahelenia =?utf-8?Q?Ziemia=C5=84ska?= Cc: Jens Axboe , Christian Brauner , Alexander Viro , linux-fsdevel@vger.kernel.org, Miklos Szeredi , linux-kernel@vger.kernel.org Subject: [PATCH RERESEND 03/11] fuse: fuse_dev_splice_read: use nonblocking I/O Message-ID: <2b5c5b0a18a59ec31f098959e26530ff607a67379.1697486714.git.nabijaczleweli@nabijaczleweli.xyz> User-Agent: NeoMutt/20231103 References: <2cover.1697486714.git.nabijaczleweli@nabijaczleweli.xyz> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="z34okndsbgotckru" Content-Disposition: inline In-Reply-To: <2cover.1697486714.git.nabijaczleweli@nabijaczleweli.xyz> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,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 morse.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 (morse.vger.email [0.0.0.0]); Thu, 14 Dec 2023 10:45:23 -0800 (PST) --z34okndsbgotckru Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Otherwise we risk sleeping with the pipe locked for indeterminate lengths of time. Link: https://lore.kernel.org/linux-fsdevel/qk6hjuam54khlaikf2ssom6custxf5i= s2ekkaequf4hvode3ls@zgf7j5j4ubvw/t/#u Signed-off-by: Ahelenia Ziemia=C5=84ska --- fs/fuse/dev.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c index 1a8f82f478cb..4e8caf66c01e 100644 --- a/fs/fuse/dev.c +++ b/fs/fuse/dev.c @@ -1202,7 +1202,8 @@ __releases(fiq->lock) * the 'sent' flag. */ static ssize_t fuse_dev_do_read(struct fuse_dev *fud, struct file *file, - struct fuse_copy_state *cs, size_t nbytes) + struct fuse_copy_state *cs, size_t nbytes, + bool nonblock) { ssize_t err; struct fuse_conn *fc =3D fud->fc; @@ -1238,7 +1239,7 @@ static ssize_t fuse_dev_do_read(struct fuse_dev *fud,= struct file *file, break; spin_unlock(&fiq->lock); =20 - if (file->f_flags & O_NONBLOCK) + if (nonblock) return -EAGAIN; err =3D wait_event_interruptible_exclusive(fiq->waitq, !fiq->connected || request_pending(fiq)); @@ -1364,7 +1365,8 @@ static ssize_t fuse_dev_read(struct kiocb *iocb, stru= ct iov_iter *to) =20 fuse_copy_init(&cs, 1, to); =20 - return fuse_dev_do_read(fud, file, &cs, iov_iter_count(to)); + return fuse_dev_do_read(fud, file, &cs, iov_iter_count(to), + file->f_flags & O_NONBLOCK); } =20 static ssize_t fuse_dev_splice_read(struct file *in, loff_t *ppos, @@ -1388,7 +1390,7 @@ static ssize_t fuse_dev_splice_read(struct file *in, = loff_t *ppos, fuse_copy_init(&cs, 1, NULL); cs.pipebufs =3D bufs; cs.pipe =3D pipe; - ret =3D fuse_dev_do_read(fud, in, &cs, len); + ret =3D fuse_dev_do_read(fud, in, &cs, len, true); if (ret < 0) goto out; =20 --=20 2.39.2 --z34okndsbgotckru Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEfWlHToQCjFzAxEFjvP0LAY0mWPEFAmV7TSoACgkQvP0LAY0m WPFH0A/+PdGoz95yW5jZpZej98hWG7cvUnL0HpsyecsebHNVXMw5OvhMvmYAGcJK Cs8DfB2AfAhC8thPDzlAtyHDmSrJZvmQNsEi/EcY+Un8cuZPfFGAqtwL6zaLIU9F Fogi7SpX5kV1gWD+l2moVog8darsv51Rvp7tq7/p9KTmZc/YRlmABGJH5ecnou3N JM51BgB2ZGzOHOeP+chMUPfb9Pmo64FqpE+9IzByBVa/dZUwZMQcmsovCznp5KAj +fWultaS54SJBoVLeyrRyCuZRtrpL3i4xY3SAkzniUERJGEewDjZFwKB07FcM3HO caocryABxB0WBtKG36eR9FTQdDGpJV42B5PyMWT8aXSrzLX7qYogsa/nBxGIn53o GAqr2/3Etx08RcaJM37cUvkGVuKyvJYWzZy2Pz2zNNpvyz8RhFVNGLaIRkMuG6Vt X83iFKqD4MPzjZiTKuKvB+UofgdkxPnl2OtgUVGLHN0NVYhKtcrCBpUJhrbIksuc 8KTS3wCkzeqU5lfjbYHYHzWB9ehQ9mtB/JgLbdUQNNGjssH3iseC1pacxxmLEoZY q+7TQooblaS7rzEoJ58q9ldXIEd4fUiMVe8pgcNT/8mbretPo8vNktnMPy04Y3bX 6e2734dikiU3aB2iOhKHOC+T8iVx6YxB2nhSRalgaCXPNNKoBgA= =RIHh -----END PGP SIGNATURE----- --z34okndsbgotckru--