From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-183.mta0.migadu.com (out-183.mta0.migadu.com [91.218.175.183]) (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 B1F2B3542CC for ; Fri, 23 Jan 2026 04:19:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.183 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769141995; cv=none; b=MCNTYISaywEqbQJBvHrTZuiCL6WRfzo54HusrwFrzEcRiVsOOmE/0p7aLZFEVYej6XlqWeT2JR+wJBy5rspxDHb5anr2bSzSy94vtr5f8UQsIehd7+v8sag02E7wSnn5W40hDPJ+MX+PxmB6GrGMWK1JVZzchSlPnPSl+8wmzk0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769141995; c=relaxed/simple; bh=RuDKmPzam/EuDUoYAC2/gqr1k9Fh+lbHsbqj/Nvj084=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=P6OTLhvPAkAccVjVAo5TdtFBSlM0pEN+0YucYeNlR/0taKzjTQzWuw+hjUlmJncLwE4INp7jkd3jPwM3IqM6r/nn6i9wxsOhNhPptUtTgu3lc7FGhHuboc0ZZyR4wH3cE5DP3lu/nJ1YEyC2XHCzpXVW09XjiTyr4GvnWRC/7Rk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=FSrZ/AcD; arc=none smtp.client-ip=91.218.175.183 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="FSrZ/AcD" Message-ID: <419976da-f296-4418-8dfe-8ad50a9f8cb5@linux.dev> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1769141964; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=N9dCsAasU81DgQOPWYby6CnKTpdlUxy0vuA+UQwIUG4=; b=FSrZ/AcDPpY9IkgQtC/Tv0e7keIPTjH1XBfImUjNZRIT9mLlA7PUKgaMD3Idj83WJkGxHh dsdcUY59+YBg4vjgRFrhM6mObWSwHBKjoaMBoa4RR3E133M2vx2xXQ5tCnwrZbpEY/DQhl AqWNhE7jV8xVWhh8EgpEFmuyDVOuYmo= Date: Fri, 23 Jan 2026 12:19:11 +0800 Precedence: bulk X-Mailing-List: linux-api@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [PATCH bpf-next v7 2/9] libbpf: Add support for extended bpf syscall Content-Language: en-US To: Alexei Starovoitov Cc: bpf , Alexei Starovoitov , Daniel Borkmann , John Fastabend , Andrii Nakryiko , Martin KaFai Lau , Eduard Zingerman , Song Liu , Yonghong Song , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Shuah Khan , Christian Brauner , Seth Forshee , Yuichiro Tsuji , Andrey Albershteyn , Willem de Bruijn , Jason Xing , Tao Chen , Mykyta Yatsenko , Kumar Kartikeya Dwivedi , Anton Protopopov , Amery Hung , Rong Tao , LKML , Linux API , "open list:KERNEL SELFTEST FRAMEWORK" , kernel-patches-bot@fb.com References: <20260123032445.125259-1-leon.hwang@linux.dev> <20260123032445.125259-3-leon.hwang@linux.dev> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Leon Hwang In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT On 23/1/26 12:12, Alexei Starovoitov wrote: > On Thu, Jan 22, 2026 at 8:07 PM Leon Hwang wrote: >> >> >> >> On 23/1/26 11:55, Alexei Starovoitov wrote: >>> On Thu, Jan 22, 2026 at 7:25 PM Leon Hwang wrote: >>>> >>>> >>>> +static int probe_bpf_syscall_common_attrs(int token_fd) >>>> +{ >>>> + int ret; >>>> + >>>> + ret = probe_sys_bpf_ext(); >>>> + return ret > 0; >>>> +} >>> >>> When you look at the above, what thoughts come to mind? >>> >>> ... and please don't use ai for answers. >> >> My initial thought was whether probe_fd() is needed here to handle and >> close a returned fd, since the return value of probe_sys_bpf_ext() isn’t >> obvious from the call site. > > Fair enough, but then collapse it into one helper if FD is a concern. > My question was about stylistic/taste preferences. Understood, thanks for the clarification. I’ll rework it with the stylistic preference in mind. Thanks, Leon