Received: by 2002:a05:7412:6592:b0:d7:7d3a:4fe2 with SMTP id m18csp1818389rdg; Sat, 12 Aug 2023 19:17:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHloDMJhRoKcBJEyTeJlGEGZXZq2ftJ2IV0jiI5XeWJqd2NLcwqIjiGOKwV1w5+AyUVF1rn X-Received: by 2002:a17:906:292a:b0:99b:4ed4:5526 with SMTP id v10-20020a170906292a00b0099b4ed45526mr4867643ejd.7.1691893067879; Sat, 12 Aug 2023 19:17:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691893067; cv=none; d=google.com; s=arc-20160816; b=dvtBfPOsQQPtsZxhuGOKvM5lcB3rIBk4CA8PWbgFo1XPFTql1UW0ncpyTnWBIt+3AP NE/Uc73MBntRt6ijOhRW32W6Iv5lKe0enb5aPC5YTFHaL00w2ArTVHfx2DQh4etyhPZ6 yXfjWUc9mQXSRY64NFntqnduAtoweKWP1WSfTc3I0dsp3mkB4jbsi5AUvoBxCHXzsVfD UnLXHTDAXg9ooTdnH6+hNlyGtQc2ESZed0ImWb2bYxopCPrMPrVs7MDmmNkhNUPcbS4J wO1nFS3IzrqQPibFROPm7f9gVxgrMRgLJ2aSTYNt3oesyWhxQzGrp+j42Dypuc2x+R1U JdBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=9htTVE9mfzukg9Ib0KifX/jAKVxmGUHomeneqy37A6s=; fh=kiq3FiTwgeIrzVC5lFfoGezpswpnXeKAcg/SeGSNeGs=; b=l7VPc+qoUMZlpFpzU9zdTtDkrwysmhlgTxVj1OaKzB2YBM75AcY2lPzoeRB5RIzjxG BJ3U8vnxfm0y9c8qx0T8oTdjfbSgBtR2lZFp0qP6KrlGxt44sNaKI0LG1yzoedGsv2ny zLlXSkJ/0oAntFGkHihkCl8NAb17nJztETSr5//w27MQJLJ580kd+1QBYReRBUr2HXKD WLkN2B0X9RcR+pfuYcxh4kpvlijzA5982UlH2QIhEqRE/mBZeA1maYQh7GXw+Vc13TGR q4pijirmXTLit/gpG6XzJVpfbrT6Dr76mZkGWLmgzNUsdJOr4gRCAYjz8rXNOfIL4wNW +xFg== ARC-Authentication-Results: i=1; mx.google.com; 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 o20-20020a17090611d400b0099364d9f0e7si5803095eja.543.2023.08.12.19.17.23; Sat, 12 Aug 2023 19:17:47 -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; 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 S229656AbjHMBNX (ORCPT + 99 others); Sat, 12 Aug 2023 21:13:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42274 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229475AbjHMBNW (ORCPT ); Sat, 12 Aug 2023 21:13:22 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CA17710C; Sat, 12 Aug 2023 18:13:21 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 4893861387; Sun, 13 Aug 2023 01:13:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 63DBFC433C8; Sun, 13 Aug 2023 01:13:19 +0000 (UTC) Date: Sat, 12 Aug 2023 21:13:17 -0400 From: Steven Rostedt To: Zheng Yejian Cc: , , , , Linus Torvalds , "Jason A. Donenfeld" , Jens Axboe , Al Viro Subject: Re: [PATCH] tracing: Fix race when concurrently splice_read trace_pipe Message-ID: <20230812211317.6d015e1d@rorschach.local.home> In-Reply-To: References: <20230810123905.1531061-1-zhengyejian1@huawei.com> <20230811152525.2511f8f0@gandalf.local.home> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 On Sat, 12 Aug 2023 15:38:12 +0800 Zheng Yejian wrote: > Reproduction testcase is show as below, it can always reproduce the > issue in v5.10, and after this patch, the testcase passed. > > In v5.10, when run `cat trace_pipe > /tmp/myfile &`, it call > sendfile() to transmit data from trace_pipe into /tmp/myfile. And in > kernel, .splice_read() of trace_pipe is called then the issue is > reproduced. > > However in the newest v6.5, this reproduction case didn't run into the > .splice_read() of trace_pipe, because after commit 97ef77c52b78 ("fs: > check FMODE_LSEEK to control internal pipe splicing"), non-seekable > trace_pipe cannot be sendfile-ed. So the test case cannot be run because the "sendfile" on the trace_pipe now fails? I'm not sure if this is considered a user space regression or not, but I figured I'd let the interested parties know. I don't know what tools out there records trace_pipe via sendfile, but there might be some. -- Steve