From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-188.mta0.migadu.com (out-188.mta0.migadu.com [91.218.175.188]) (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 E90D137881F; Fri, 23 Jan 2026 04:19:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.188 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769141983; cv=none; b=IPMwUT4uoLzeILoCNH300Ln85dqJB6PCCDi4tSuo791LOw3u5QpA6msjyMS/NCG5NlZzOHFD9X8YnOaZXkiHvTLFQDdAqQmhpCNiZ42PW6FA9qTtlxztQQL3ePGUGRqgt2Ofdj8Hew+yLItLU9x9/4uJaZuiN6H7EoFfjt0B+6E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769141983; 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=KghnUPZTgBM4+lQjisV2BsXkd5H6A8qsVdAZbhzNB+JEhLNEbZMnHlcnaNptwFZuOwDHSWAXOZouQuqx1mEFFj8WWbT/MrOgwTMvH5PXf83ApzogahIzkD/oBzJlQF35z5qpUDDKDJeKePkF7Y9VJL5I1Z6mQqF9IMg7ke+2xmA= 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.188 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-kselftest@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