From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E7CC963CC for ; Thu, 31 Aug 2023 10:42:24 +0000 (UTC) Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B86CACF3 for ; Thu, 31 Aug 2023 03:42:21 -0700 (PDT) Received: by mail-ed1-x536.google.com with SMTP id 4fb4d7f45d1cf-51e28cac164so3904430a12.1 for ; Thu, 31 Aug 2023 03:42:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1693478540; x=1694083340; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:date:from:from:to :cc:subject:date:message-id:reply-to; bh=AI1c6/zxcVTKMOd4aSToYNMwX2pq4pMGNmpPkOO9lg4=; b=nPNAT3qdCbrRvOcUKfON5HOka5ilsTWT2q6HNvoZLbG+pRQGzyRajYfHGkTeFXysTf SIpWQRwSt/qVDovQitkTeZpTirNNo+QMRLdu9LanDVNFHyr8V68AqVoOeOVmzg5tpsZ1 KfDCTwWkvWoOfE7dxTy57VZJj2snQaSxtbscQOuI6uP5PQf74ygJMd5nY7dFntYij6vA 7yIaOzJ/x8H0XhTZoJu3uQvG04FyYz5v4JbstLKy4hjNqSS3AqHDvvyUSF0dDcQq5YBA 3k2YXuq4UMd8pOvOBTnu90iC0Fd1DR1+9OB0utgqM5OtjL4oMdigWMm2tcNUM7VHjN/x 1JOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693478540; x=1694083340; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:date:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=AI1c6/zxcVTKMOd4aSToYNMwX2pq4pMGNmpPkOO9lg4=; b=lQzklf2Gskk+1I8CnkKv2hKMiAQe8kxLJ/MUMwcZtUk6yG6r/xbgfJT8GYPklGfuk4 ZQjW4yzHzw2gvj+CRx+ot/a4MQZULOxP6TrITxEQwEThQkVC4Sv/4bG5DNbtVdTYLALe SzSeBQDwblF3Vu/fonQwMFnzB2Gcl4pyYcCEM0kCXvI1voX7FCtlfbfwcRywDGbOaf7E XY58ah4CJ/thXbSfB4vlJJGluZjTbWEH8vn/47EkzP9GV71rjXaylUu+2DvHtpUyHMWP nSNvQpyj8sOSq7GXTNzz9JeA80qbVdIzYu6IQRqNbD/b25sME5yewdXsZef7MQJHghRB fN6w== X-Gm-Message-State: AOJu0YxwitHGZxk+I6ih15zTC00+zYOwIQw5HMwl2Nko82RM/IpQdCDY PBsLw4LqTgjRlK+hSBhJYAE= X-Google-Smtp-Source: AGHT+IEoCcg/6TXFxEjcgPuTSB3nMU8PX614EDOXPbNI3TY6IJDTTUU93PvFoD84KZU64oq6t0LJyw== X-Received: by 2002:a17:907:7202:b0:9a2:25da:d71e with SMTP id dr2-20020a170907720200b009a225dad71emr2777668ejc.0.1693478539873; Thu, 31 Aug 2023 03:42:19 -0700 (PDT) Received: from krava (2001-1ae9-1c2-4c00-726e-c10f-8833-ff22.ip6.tmcz.cz. [2001:1ae9:1c2:4c00:726e:c10f:8833:ff22]) by smtp.gmail.com with ESMTPSA id x24-20020a170906805800b009894b476310sm609557ejw.163.2023.08.31.03.42.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Aug 2023 03:42:19 -0700 (PDT) From: Jiri Olsa X-Google-Original-From: Jiri Olsa Date: Thu, 31 Aug 2023 12:42:17 +0200 To: Alexei Starovoitov Cc: Jiri Olsa , Song Liu , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , bpf , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Hou Tao , Viktor Malik Subject: Re: [RFC/PATCH bpf-next] bpf: Fix d_path test after last fs update Message-ID: References: <20230830093502.1436694-1-jolsa@kernel.org> Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_BLOCKED,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 On Wed, Aug 30, 2023 at 01:29:18PM -0700, Alexei Starovoitov wrote: > On Wed, Aug 30, 2023 at 12:04 PM Jiri Olsa wrote: > > > > On Wed, Aug 30, 2023 at 02:35:49PM -0400, Song Liu wrote: > > > On Wed, Aug 30, 2023 at 9:27 AM Jiri Olsa wrote: > > > > > > > > On Wed, Aug 30, 2023 at 11:35:02AM +0200, Jiri Olsa wrote: > > > > > Recent commit [1] broken d_path test, because now filp_close is not > > > > > called directly from sys_close, but eventually later when the file > > > > > is finally released. > > > > > > > > > > I can't see any other solution than to hook filp_flush function and > > > > > that also means we need to add it to btf_allowlist_d_path list, so > > > > > it can use the d_path helper. > > > > > > > > > > But it's probably not very stable because filp_flush is static so it > > > > > could be potentially inlined. > > > > > > > > looks like llvm makes it inlined (from CI) > > > > > > > > Error: #68/1 d_path/basic > > > > libbpf: prog 'prog_close': failed to find kernel BTF type ID of 'filp_flush': -3 > > > > > > > > jirka > > > > > > I played with it for a bit, but haven't got a good solution. Maybe we should > > > just remove the test for close()? > > > > I was thinking the same.. also we have some example with filp_close in bpftrace > > docs, I think we'll need to add some note with explanation in there > > Maybe use __x64_sys_close in the test and recommend bpftrace scripts > to do the same? we need struct file pointer as an argument, __x64_sys_close has pt_regs pointer jirka