From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTP id 889EC385842A for ; Mon, 23 Dec 2024 09:31:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 889EC385842A Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 889EC385842A Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1734946318; cv=none; b=GgMJspSXyLk2R6DwPpnGMQIzRPjRdIpl9anMHKbLbFVV49F7Ind/UfsDKBx2+JbJpF2Exk5xxZ8v/HQ5B82RnMNd8MJ1AC7eH2xzkG8h3WxfC+UnK8SaJlabvNArsx+nlx8lsFhOf3t/YOECEFh98jegNBtW39X/9JKBjvo3wLw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1734946318; c=relaxed/simple; bh=TkEiWqZH22UB54eiuf7sXIo2XHB/8gGUVSAWn6k6V6g=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=ewMnXlwrU769cr+q2E7UIdSn1fV2PJetuMJVYdiIv8ClKAkIhkhGKylFK6L/7e8DNe6WVcEiYLdeyv9PRBZE4dQAMP1eZtG/MV4u/pqsFEqFdt/qy6Co2unOBc6ndWiAdGXF6RsehGmFoZ1kjs5Tj2XahjnoEjB64iutzB5PoOg= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 889EC385842A Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=JyNt23Ra DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1734946318; 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: in-reply-to:in-reply-to:references:references; bh=AIue7ZNsfRIxvYcsMB53MsNjCZb5Z0cYGdtbnI2yHS0=; b=JyNt23RaIvuUOZ8aMKtn3w6VbWdtWZDNxwtQIoWrdRftNVOorFNmtcfD2D/3gtNF36AkaW NXZqFFLb3Pny7/V7koNeBQZ3YYDhtj5i0v0PfF9eCV23bSLh3xect3Lu2zFX0DWVmRwsXN BsGFYkC9Zdq87rE44dhP4rk5xwpaOCA= Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-675-d1RQeiCsMNWI5R94HmZWKw-1; Mon, 23 Dec 2024 04:31:51 -0500 X-MC-Unique: d1RQeiCsMNWI5R94HmZWKw-1 X-Mimecast-MFC-AGG-ID: d1RQeiCsMNWI5R94HmZWKw Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 09B8D1956051; Mon, 23 Dec 2024 09:31:50 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.39.192.21]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D44C819560A2; Mon, 23 Dec 2024 09:31:47 +0000 (UTC) From: Florian Weimer To: Xi Ruoyao Cc: libc-alpha@sourceware.org, Adhemerval Zanella , Joseph Myers , Miao Wang Subject: Re: [PATCH] io: statx, fstatat: Drop nonnull attribute on the path argument In-Reply-To: <874j2zy7al.fsf@oldenburg.str.redhat.com> (Florian Weimer's message of "Thu, 19 Dec 2024 17:19:30 +0100") References: <20241003185139.1600545-2-xry111@xry111.site> <874j2zy7al.fsf@oldenburg.str.redhat.com> Date: Mon, 23 Dec 2024 10:31:44 +0100 Message-ID: <875xnapwxr.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 7fp7Ml6CkDvNYuN3qQAIWZdHbBbcuMCrQLgljqKtOto_1734946310 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-10.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: * Florian Weimer: > * Xi Ruoyao: > >> From: Miao Wang >> >> Since Linux 6.11 the kernel allows path to be NULL if flags & >> AT_EMPTY_PATH. Let's allow users to take the advantage if they don't >> care running on old kernels. >> >> [ xry111: separate the obvious change from the controversial >> "io: statx, fstatat64: allow using NULL as path" patch ] >> >> Signed-off-by: Miao Wang >> Signed-off-by: Xi Ruoyao >> --- >> io/bits/statx-generic.h | 2 +- >> io/sys/stat.h | 10 +++++----- >> 2 files changed, 6 insertions(+), 6 deletions(-) >> >> diff --git a/io/bits/statx-generic.h b/io/bits/statx-generic.h >> index 19c3565edc..c0e00c9d8b 100644 >> --- a/io/bits/statx-generic.h >> +++ b/io/bits/statx-generic.h >> @@ -62,6 +62,6 @@ __BEGIN_DECLS >> /* Fill *BUF with information about PATH in DIRFD. */ >> int statx (int __dirfd, const char *__restrict __path, int __flags, >> unsigned int __mask, struct statx *__restrict __buf) >> - __THROW __nonnull ((2, 5)); >> + __THROW __nonnull ((5)); >> >> __END_DECLS >> diff --git a/io/sys/stat.h b/io/sys/stat.h >> index 3b4ba80132..7ea39b8755 100644 >> --- a/io/sys/stat.h >> +++ b/io/sys/stat.h >> @@ -263,14 +263,14 @@ extern int __REDIRECT_NTH (fstat64, (int __fd, struct stat64 *__buf), >> # ifndef __USE_FILE_OFFSET64 >> extern int fstatat (int __fd, const char *__restrict __file, >> struct stat *__restrict __buf, int __flag) >> - __THROW __nonnull ((2, 3)); >> + __THROW __nonnull ((3)); >> # else >> # ifdef __USE_TIME64_REDIRECTS >> # ifdef __REDIRECT_NTH >> extern int __REDIRECT_NTH (fstatat, (int __fd, const char *__restrict __file, >> struct stat *__restrict __buf, >> int __flag), >> - __fstatat64_time64) __nonnull ((2, 3)); >> + __fstatat64_time64) __nonnull ((3)); >> # else >> # define fstatat __fstatat64_time64 >> # endif >> @@ -279,7 +279,7 @@ extern int __REDIRECT_NTH (fstatat, (int __fd, const char *__restrict __file, >> extern int __REDIRECT_NTH (fstatat, (int __fd, const char *__restrict __file, >> struct stat *__restrict __buf, >> int __flag), >> - fstatat64) __nonnull ((2, 3)); >> + fstatat64) __nonnull ((3)); >> # else >> # define fstatat fstatat64 >> # endif >> @@ -290,7 +290,7 @@ extern int __REDIRECT_NTH (fstatat, (int __fd, const char *__restrict __file, >> # ifndef __USE_TIME64_REDIRECTS >> extern int fstatat64 (int __fd, const char *__restrict __file, >> struct stat64 *__restrict __buf, int __flag) >> - __THROW __nonnull ((2, 3)); >> + __THROW __nonnull ((3)); >> # else >> # ifdef __REDIRECT_NTH >> extern int __REDIRECT_NTH (fstatat64, (int __fd, >> @@ -298,7 +298,7 @@ extern int __REDIRECT_NTH (fstatat64, (int __fd, >> struct stat64 *__restrict __buf, >> int __flag), >> __fstatat64_time64) >> - __nonnull ((2, 3)); >> + __nonnull ((3)); >> # else >> # define fstatat64 __fstatat64_time64 >> # endif > > This looks good to me. > > Reviewed-by: Florian Weimer > > Any objections to pushing this? Hearing no objections, I've pushed this. Thanks, Florian