Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp31051998rwd; Thu, 6 Jul 2023 15:04:45 -0700 (PDT) X-Google-Smtp-Source: APBJJlGX83c/VITjmAfgQpZRqYGClDC3pAT7/2f8xCT5wg3knoGrqe3qLy0FkGrQ0D2G1top/uiP X-Received: by 2002:a17:90a:928a:b0:262:ee7d:2d1f with SMTP id n10-20020a17090a928a00b00262ee7d2d1fmr2539248pjo.21.1688681085071; Thu, 06 Jul 2023 15:04:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688681085; cv=none; d=google.com; s=arc-20160816; b=dHp3YUEdxHUfuEomACY47iIyK7lIrI4jen3myjCnnZM0F4+NNIuOvGhYemx+nt0j5F JJk+RzJ/gWIxMKnRBZqQuGEvvG3GXCzsjYTUukOFgM7wAiRQumgFsb+xORqiweMoYV1E 2B4BHNW9bRq1BeJ4oGjPnxMxr/NHMg2aHlaBfDyGpkeohXR6DmuhdRBlxQ/6uiSim10t zleYiQznnUtlQMz9YJoAMOXwEH7Ov2vkRZKIBgwyRZ6hzwex728tuK4M5kkDqjBVd0WA Y9QrsiTUQ+Vh3CP7pRN9vykJo7EDz6AAH0l24kIaxhXeowDKT/jbBlDKcb8wUMWw1oH9 Vq3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=AVnhNg7qkZFpMTP0oagP3cgCf8IJ5Q1wLEIQcCh535o=; fh=oG/VNmW4AJWGtL4MWiEK/gPzCFKJNdDT1OLkdPA0RO0=; b=QEDEXrtAsQWSBlQS8jxEbwdn2csT4C/Mjrc8Dk12Tjtqvph7yQDAoyehzYM6tt6UKN LN7GB6rqOWEn9xLZxLUmTso/8Hjuobm/0MwNxddFjxQi5+WPoqx1sUgcBbN0A6JYzU68 fx9y1lFlQX+aFUoZczpvQh5+lgY2Qu3HvqLwJarwIaf6M/8pY3cM+kOI96BE1L8+JRRi 4vtKydSy3omy5K1Ve07QzprpH4Bi0IgJZcTd4vxCS1hi7EMkWlIZ7kfWjiGlhVylrLEh zkohhaonORIwbnV613T9qtypTJJHIvz9rmZUMUMCXgvPzRvummR1iNMzPXoFRE6IVDSN QTXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=MvBMImMh; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r6-20020a17090b050600b0025c16614fa6si503530pjz.145.2023.07.06.15.04.30; Thu, 06 Jul 2023 15:04:45 -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=@linux-foundation.org header.s=google header.b=MvBMImMh; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230445AbjGFV5J (ORCPT + 99 others); Thu, 6 Jul 2023 17:57:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229489AbjGFV5I (ORCPT ); Thu, 6 Jul 2023 17:57:08 -0400 Received: from mail-lj1-x22c.google.com (mail-lj1-x22c.google.com [IPv6:2a00:1450:4864:20::22c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F8F7E1 for ; Thu, 6 Jul 2023 14:57:06 -0700 (PDT) Received: by mail-lj1-x22c.google.com with SMTP id 38308e7fff4ca-2b6afc1ceffso18952821fa.0 for ; Thu, 06 Jul 2023 14:57:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; t=1688680624; x=1691272624; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=AVnhNg7qkZFpMTP0oagP3cgCf8IJ5Q1wLEIQcCh535o=; b=MvBMImMhdvHidhBzL6uqZxx6yzVRes6iV58FCq8wlDtFedCDMKFsPCQCW2bAVtyCr7 KGD2noEW89s15OLBP5uyX8JKNqczU9IDts0LnmdUTC7F/MYgyD4obOqrl0YMeQUwLDYQ 3DvDcCwBZCTVwplFebSInLXoGUMVQhbSnueYM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688680624; x=1691272624; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=AVnhNg7qkZFpMTP0oagP3cgCf8IJ5Q1wLEIQcCh535o=; b=jTzE/J7SAYDnhAwhfjJmdWr6WEoJOulhVGgCYFJEqHoE5EVMcX8LIUdyjL3e4ioIIf ziOafV02cl0sE55L08+WMuNYNBYRH7xfCmdGlM/yvx9YZ1Fojx8r3ICt+ZHRzPAqLCPz sSYK17duPROvT0/A9y6F02k8DhWrTu2muvm7zNFCt54enkYgDxbGLMMbLYR96TWYPK+F hvBUYbDxK9a9JHYwMZeIoeLBO4QPu3SVnhzmSc7mFPJSibYqgg5OWDmw91BnOjr6QFaF gX/tdzUidNT919MVl24UeLKxiqZLIzcDLfZ0RH90oMMvbT9l+9qbmKVKzMOTGWCOUiZU 6gtQ== X-Gm-Message-State: ABy/qLZvHCzlaOIRBqWIU84dvXfHgMgeiTsW+dBBeYD+KDbzySLRyLRC kCww1V5q9OecDS7oLMRpq4luEIyP/xjURfi34rOr6Q== X-Received: by 2002:a2e:9685:0:b0:2b6:e332:1d6b with SMTP id q5-20020a2e9685000000b002b6e3321d6bmr2043715lji.52.1688680624038; Thu, 06 Jul 2023 14:57:04 -0700 (PDT) Received: from mail-lj1-f171.google.com (mail-lj1-f171.google.com. [209.85.208.171]) by smtp.gmail.com with ESMTPSA id o15-20020a2e9b4f000000b002b6ff6e7dccsm494582ljj.26.2023.07.06.14.57.02 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 06 Jul 2023 14:57:03 -0700 (PDT) Received: by mail-lj1-f171.google.com with SMTP id 38308e7fff4ca-2b6afc1ceffso18952401fa.0 for ; Thu, 06 Jul 2023 14:57:02 -0700 (PDT) X-Received: by 2002:ac2:4c46:0:b0:4fb:85ad:b6e2 with SMTP id o6-20020ac24c46000000b004fb85adb6e2mr2691388lfk.50.1688680622427; Thu, 06 Jul 2023 14:57:02 -0700 (PDT) MIME-Version: 1.0 References: <20230626-vorverlegen-setzen-c7f96e10df34@brauner> <4sdy3yn462gdvubecjp4u7wj7hl5aah4kgsxslxlyqfnv67i72@euauz57cr3ex> <20230626-fazit-campen-d54e428aa4d6@brauner> In-Reply-To: From: Linus Torvalds Date: Thu, 6 Jul 2023 14:56:45 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Pending splice(file -> FIFO) excludes all other FIFO operations forever (was: ... always blocks read(FIFO), regardless of O_NONBLOCK on read side?) To: =?UTF-8?Q?Ahelenia_Ziemia=C5=84ska?= Cc: Christian Brauner , Jens Axboe , David Howells , Alexander Viro , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: multipart/mixed; boundary="000000000000a4b41205ffd898be" X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no 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 --000000000000a4b41205ffd898be Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, 26 Jun 2023 at 09:14, Ahelenia Ziemia=C5=84ska wrote: > > And even if that was a working work-around, the fundamental problem of > ./spl>fifo excluding all other access to fifo is quite unfortunate too. So I already sent an earlier broken version of this patch to Ahelenia and Christian, but here's an actually slightly tested version with the obvious bugs fixed. The keyword here being "obvious". It's probably broken in many non-obvious ways, but I'm sending it out in case anybody wants to play around with it. It boots for me. It even changes behavior of programs that splice() and used to keep the pipe lock over the IO and no longer do. But it might do unspeakable things to your pets, so caveat emptor. It "feels" right to me. But it's a rather quick hack, and really needs more eyes and more thought. I mention O_NDELAY in the (preliminary) commit message, but there are probably other issues that need thinking about. Linus --000000000000a4b41205ffd898be Content-Type: text/x-patch; charset="US-ASCII"; name="0001-splice-lock-the-pages-and-unlock-the-pipe-during-IO.patch" Content-Disposition: attachment; filename="0001-splice-lock-the-pages-and-unlock-the-pipe-during-IO.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_ljrotv5r0 RnJvbSAzNDc1ZTRkNTZjZWZhYjlmOGIwNjFkYzgyNGRiNGUzMTRkMDc2YTU5IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBMaW51cyBUb3J2YWxkcyA8dG9ydmFsZHNAbGludXgtZm91bmRh dGlvbi5vcmc+CkRhdGU6IFRodSwgNiBKdWwgMjAyMyAxMToyMzowNyAtMDcwMApTdWJqZWN0OiBb UEFUQ0hdIHNwbGljZTogbG9jayB0aGUgcGFnZXMgYW5kIHVubG9jayB0aGUgcGlwZSBkdXJpbmcg SU8KClRoaXMgaXMgYWxyZWFkeSB3aGF0IHdlIGRvIGZvciBwYWdlIGNhY2hlIHBhZ2VzLCB3aGVy ZSB3ZSBjYW4gYWRkIHJhdwpwYWdlcyB0aGF0IGFyZSBub3QgdXAtdG8tZGF0ZSB5ZXQgd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