linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] uapi/fcntl: conditionally define AT_RENAME* macros
@ 2025-08-24 22:10 Randy Dunlap
  2025-08-24 23:21 ` Matthew Wilcox
  0 siblings, 1 reply; 9+ messages in thread
From: Randy Dunlap @ 2025-08-24 22:10 UTC (permalink / raw)
  To: linux-kernel
  Cc: Randy Dunlap, Amir Goldstein, Jeff Layton, Chuck Lever,
	Alexander Aring, Josef Bacik, Aleksa Sarai, Jan Kara,
	Christian Brauner, linux-fsdevel, linux-api

Don't define the AT_RENAME_* macros when __USE_GNU is defined since
/usr/include/stdio.h defines them in that case (i.e. when _GNU_SOURCE
is defined, which causes __USE_GNU to be defined).

Having them defined in 2 places causes build warnings (duplicate
definitions) in both samples/watch_queue/watch_test.c and
samples/vfs/test-statx.c.

Fixes: b4fef22c2fb9 ("uapi: explain how per-syscall AT_* flags should be allocated")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
---
Cc: Amir Goldstein <amir73il@gmail.com>
Cc: Jeff Layton <jlayton@kernel.org>
Cc: Chuck Lever <chuck.lever@oracle.com>
Cc: Alexander Aring <alex.aring@gmail.com>
Cc: Josef Bacik <josef@toxicpanda.com>
Cc: Aleksa Sarai <cyphar@cyphar.com>
Cc: Jan Kara <jack@suse.cz>
Cc: Christian Brauner <brauner@kernel.org>
Cc: linux-fsdevel@vger.kernel.org
CC: linux-api@vger.kernel.org

 include/uapi/linux/fcntl.h |    2 ++
 1 file changed, 2 insertions(+)

--- linux-next-20250819.orig/include/uapi/linux/fcntl.h
+++ linux-next-20250819/include/uapi/linux/fcntl.h
@@ -155,10 +155,12 @@
  * as possible, so we can use them for generic bits in the future if necessary.
  */
 
+#ifndef __USE_GNU
 /* Flags for renameat2(2) (must match legacy RENAME_* flags). */
 #define AT_RENAME_NOREPLACE	0x0001
 #define AT_RENAME_EXCHANGE	0x0002
 #define AT_RENAME_WHITEOUT	0x0004
+#endif
 
 /* Flag for faccessat(2). */
 #define AT_EACCESS		0x200	/* Test access permitted for

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] uapi/fcntl: conditionally define AT_RENAME* macros
  2025-08-24 22:10 [PATCH] uapi/fcntl: conditionally define AT_RENAME* macros Randy Dunlap
@ 2025-08-24 23:21 ` Matthew Wilcox
  2025-08-24 23:54   ` Randy Dunlap
  0 siblings, 1 reply; 9+ messages in thread
From: Matthew Wilcox @ 2025-08-24 23:21 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: linux-kernel, Amir Goldstein, Jeff Layton, Chuck Lever,
	Alexander Aring, Josef Bacik, Aleksa Sarai, Jan Kara,
	Christian Brauner, linux-fsdevel, linux-api

On Sun, Aug 24, 2025 at 03:10:55PM -0700, Randy Dunlap wrote:
> Don't define the AT_RENAME_* macros when __USE_GNU is defined since
> /usr/include/stdio.h defines them in that case (i.e. when _GNU_SOURCE
> is defined, which causes __USE_GNU to be defined).
> 
> Having them defined in 2 places causes build warnings (duplicate
> definitions) in both samples/watch_queue/watch_test.c and
> samples/vfs/test-statx.c.

It does?  What flags?

#define AT_RENAME_NOREPLACE     0x0001
#define AT_RENAME_NOREPLACE     0x0001

int main(void)
{
	return AT_RENAME_NOREPLACE;
}

gcc -W -Wall testA.c -o testA

(no warnings)

I'm pretty sure C says that duplicate definitions are fine as long
as they're identical.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] uapi/fcntl: conditionally define AT_RENAME* macros
  2025-08-24 23:21 ` Matthew Wilcox
@ 2025-08-24 23:54   ` Randy Dunlap
  2025-08-25  5:58     ` Amir Goldstein
  2025-08-25 13:03     ` Matthew Wilcox
  0 siblings, 2 replies; 9+ messages in thread
From: Randy Dunlap @ 2025-08-24 23:54 UTC (permalink / raw)
  To: Matthew Wilcox
  Cc: linux-kernel, Amir Goldstein, Jeff Layton, Chuck Lever,
	Alexander Aring, Josef Bacik, Aleksa Sarai, Jan Kara,
	Christian Brauner, linux-fsdevel, linux-api



On 8/24/25 4:21 PM, Matthew Wilcox wrote:
> On Sun, Aug 24, 2025 at 03:10:55PM -0700, Randy Dunlap wrote:
>> Don't define the AT_RENAME_* macros when __USE_GNU is defined since
>> /usr/include/stdio.h defines them in that case (i.e. when _GNU_SOURCE
>> is defined, which causes __USE_GNU to be defined).
>>
>> Having them defined in 2 places causes build warnings (duplicate
>> definitions) in both samples/watch_queue/watch_test.c and
>> samples/vfs/test-statx.c.
> 
> It does?  What flags?
> 

for samples/vfs/test-statx.c:

In file included from ../samples/vfs/test-statx.c:23:
usr/include/linux/fcntl.h:159:9: warning: ‘AT_RENAME_NOREPLACE’ redefined
  159 | #define AT_RENAME_NOREPLACE     0x0001
In file included from ../samples/vfs/test-statx.c:13:
/usr/include/stdio.h:171:10: note: this is the location of the previous definition
  171 | # define AT_RENAME_NOREPLACE RENAME_NOREPLACE
usr/include/linux/fcntl.h:160:9: warning: ‘AT_RENAME_EXCHANGE’ redefined
  160 | #define AT_RENAME_EXCHANGE      0x0002
/usr/include/stdio.h:173:10: note: this is the location of the previous definition
  173 | # define AT_RENAME_EXCHANGE RENAME_EXCHANGE
usr/include/linux/fcntl.h:161:9: warning: ‘AT_RENAME_WHITEOUT’ redefined
  161 | #define AT_RENAME_WHITEOUT      0x0004
/usr/include/stdio.h:175:10: note: this is the location of the previous definition
  175 | # define AT_RENAME_WHITEOUT RENAME_WHITEOUT

for samples/watch_queue/watch_test.c:

In file included from usr/include/linux/watch_queue.h:6,
                 from ../samples/watch_queue/watch_test.c:19:
usr/include/linux/fcntl.h:159:9: warning: ‘AT_RENAME_NOREPLACE’ redefined
  159 | #define AT_RENAME_NOREPLACE     0x0001
In file included from ../samples/watch_queue/watch_test.c:11:
/usr/include/stdio.h:171:10: note: this is the location of the previous definition
  171 | # define AT_RENAME_NOREPLACE RENAME_NOREPLACE
usr/include/linux/fcntl.h:160:9: warning: ‘AT_RENAME_EXCHANGE’ redefined
  160 | #define AT_RENAME_EXCHANGE      0x0002
/usr/include/stdio.h:173:10: note: this is the location of the previous definition
  173 | # define AT_RENAME_EXCHANGE RENAME_EXCHANGE
usr/include/linux/fcntl.h:161:9: warning: ‘AT_RENAME_WHITEOUT’ redefined
  161 | #define AT_RENAME_WHITEOUT      0x0004
/usr/include/stdio.h:175:10: note: this is the location of the previous definition
  175 | # define AT_RENAME_WHITEOUT RENAME_WHITEOUT


> #define AT_RENAME_NOREPLACE     0x0001
> #define AT_RENAME_NOREPLACE     0x0001
> 
> int main(void)
> {
> 	return AT_RENAME_NOREPLACE;
> }
> 
> gcc -W -Wall testA.c -o testA
> 
> (no warnings)
> 
> I'm pretty sure C says that duplicate definitions are fine as long
> as they're identical.
The vales are identical but the strings are not identical.

We can't fix stdio.h, but we could just change uapi/linux/fcntl.h
to match stdio.h. I suppose.

-- 
~Randy


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] uapi/fcntl: conditionally define AT_RENAME* macros
  2025-08-24 23:54   ` Randy Dunlap
@ 2025-08-25  5:58     ` Amir Goldstein
  2025-08-25  6:49       ` Randy Dunlap
  2025-08-25 13:03     ` Matthew Wilcox
  1 sibling, 1 reply; 9+ messages in thread
From: Amir Goldstein @ 2025-08-25  5:58 UTC (permalink / raw)
  To: Randy Dunlap, Aleksa Sarai
  Cc: Matthew Wilcox, linux-kernel, Jeff Layton, Chuck Lever,
	Alexander Aring, Josef Bacik, Jan Kara, Christian Brauner,
	linux-fsdevel, linux-api

On Mon, Aug 25, 2025 at 1:54 AM Randy Dunlap <rdunlap@infradead.org> wrote:
>
>
>
> On 8/24/25 4:21 PM, Matthew Wilcox wrote:
> > On Sun, Aug 24, 2025 at 03:10:55PM -0700, Randy Dunlap wrote:
> >> Don't define the AT_RENAME_* macros when __USE_GNU is defined since
> >> /usr/include/stdio.h defines them in that case (i.e. when _GNU_SOURCE
> >> is defined, which causes __USE_GNU to be defined).
> >>
> >> Having them defined in 2 places causes build warnings (duplicate
> >> definitions) in both samples/watch_queue/watch_test.c and
> >> samples/vfs/test-statx.c.
> >
> > It does?  What flags?
> >
>
> for samples/vfs/test-statx.c:
>
> In file included from ../samples/vfs/test-statx.c:23:
> usr/include/linux/fcntl.h:159:9: warning: ‘AT_RENAME_NOREPLACE’ redefined
>   159 | #define AT_RENAME_NOREPLACE     0x0001
> In file included from ../samples/vfs/test-statx.c:13:
> /usr/include/stdio.h:171:10: note: this is the location of the previous definition
>   171 | # define AT_RENAME_NOREPLACE RENAME_NOREPLACE
> usr/include/linux/fcntl.h:160:9: warning: ‘AT_RENAME_EXCHANGE’ redefined
>   160 | #define AT_RENAME_EXCHANGE      0x0002
> /usr/include/stdio.h:173:10: note: this is the location of the previous definition
>   173 | # define AT_RENAME_EXCHANGE RENAME_EXCHANGE
> usr/include/linux/fcntl.h:161:9: warning: ‘AT_RENAME_WHITEOUT’ redefined
>   161 | #define AT_RENAME_WHITEOUT      0x0004
> /usr/include/stdio.h:175:10: note: this is the location of the previous definition
>   175 | # define AT_RENAME_WHITEOUT RENAME_WHITEOUT
>
> for samples/watch_queue/watch_test.c:
>
> In file included from usr/include/linux/watch_queue.h:6,
>                  from ../samples/watch_queue/watch_test.c:19:
> usr/include/linux/fcntl.h:159:9: warning: ‘AT_RENAME_NOREPLACE’ redefined
>   159 | #define AT_RENAME_NOREPLACE     0x0001
> In file included from ../samples/watch_queue/watch_test.c:11:
> /usr/include/stdio.h:171:10: note: this is the location of the previous definition
>   171 | # define AT_RENAME_NOREPLACE RENAME_NOREPLACE
> usr/include/linux/fcntl.h:160:9: warning: ‘AT_RENAME_EXCHANGE’ redefined
>   160 | #define AT_RENAME_EXCHANGE      0x0002
> /usr/include/stdio.h:173:10: note: this is the location of the previous definition
>   173 | # define AT_RENAME_EXCHANGE RENAME_EXCHANGE
> usr/include/linux/fcntl.h:161:9: warning: ‘AT_RENAME_WHITEOUT’ redefined
>   161 | #define AT_RENAME_WHITEOUT      0x0004
> /usr/include/stdio.h:175:10: note: this is the location of the previous definition
>   175 | # define AT_RENAME_WHITEOUT RENAME_WHITEOUT
>
>
> > #define AT_RENAME_NOREPLACE     0x0001
> > #define AT_RENAME_NOREPLACE     0x0001
> >
> > int main(void)
> > {
> >       return AT_RENAME_NOREPLACE;
> > }
> >
> > gcc -W -Wall testA.c -o testA
> >
> > (no warnings)
> >
> > I'm pretty sure C says that duplicate definitions are fine as long
> > as they're identical.
> The vales are identical but the strings are not identical.
>
> We can't fix stdio.h, but we could just change uapi/linux/fcntl.h
> to match stdio.h. I suppose.

I do not specifically object to a patch like this (assuming that is works?):

--- a/include/uapi/linux/fcntl.h
+++ b/include/uapi/linux/fcntl.h
@@ -156,9 +156,9 @@
  */

 /* Flags for renameat2(2) (must match legacy RENAME_* flags). */
-#define AT_RENAME_NOREPLACE    0x0001
-#define AT_RENAME_EXCHANGE     0x0002
-#define AT_RENAME_WHITEOUT     0x0004
+#define AT_RENAME_NOREPLACE    RENAME_NOREPLACE
+#define AT_RENAME_EXCHANGE     RENAME_EXCHANGE
+#define AT_RENAME_WHITEOUT     RENAME_WHITEOUT


But to be clear, this is a regression introduced by glibc that is likely
to break many other builds, not only the kernel samples
and even if we fix linux uapi to conform to its downstream
copy of definitions, it won't help those users whose programs
build was broken until they install kernel headers, so feels like you
should report this regression to glibc and they'd better not "fix" the
regression by copying the current definition string as that may change as per
the patch above.

Why would a library copy definitions from kernel uapi without
wrapping them with #ifndef or #undef?

Thanks,
Amir.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] uapi/fcntl: conditionally define AT_RENAME* macros
  2025-08-25  5:58     ` Amir Goldstein
@ 2025-08-25  6:49       ` Randy Dunlap
  0 siblings, 0 replies; 9+ messages in thread
From: Randy Dunlap @ 2025-08-25  6:49 UTC (permalink / raw)
  To: Amir Goldstein, Aleksa Sarai
  Cc: Matthew Wilcox, linux-kernel, Jeff Layton, Chuck Lever,
	Alexander Aring, Josef Bacik, Jan Kara, Christian Brauner,
	linux-fsdevel, linux-api

Hi Amir,


On 8/24/25 10:58 PM, Amir Goldstein wrote:
> On Mon, Aug 25, 2025 at 1:54 AM Randy Dunlap <rdunlap@infradead.org> wrote:
>>
>>
>>
>> On 8/24/25 4:21 PM, Matthew Wilcox wrote:
>>> On Sun, Aug 24, 2025 at 03:10:55PM -0700, Randy Dunlap wrote:
>>>> Don't define the AT_RENAME_* macros when __USE_GNU is defined since
>>>> /usr/include/stdio.h defines them in that case (i.e. when _GNU_SOURCE
>>>> is defined, which causes __USE_GNU to be defined).
>>>>
>>>> Having them defined in 2 places causes build warnings (duplicate
>>>> definitions) in both samples/watch_queue/watch_test.c and
>>>> samples/vfs/test-statx.c.
>>>
>>> It does?  What flags?
>>>
>>
>> for samples/vfs/test-statx.c:
>>
>> In file included from ../samples/vfs/test-statx.c:23:
>> usr/include/linux/fcntl.h:159:9: warning: ‘AT_RENAME_NOREPLACE’ redefined
>>   159 | #define AT_RENAME_NOREPLACE     0x0001
>> In file included from ../samples/vfs/test-statx.c:13:
>> /usr/include/stdio.h:171:10: note: this is the location of the previous definition
>>   171 | # define AT_RENAME_NOREPLACE RENAME_NOREPLACE
>> usr/include/linux/fcntl.h:160:9: warning: ‘AT_RENAME_EXCHANGE’ redefined
>>   160 | #define AT_RENAME_EXCHANGE      0x0002
>> /usr/include/stdio.h:173:10: note: this is the location of the previous definition
>>   173 | # define AT_RENAME_EXCHANGE RENAME_EXCHANGE
>> usr/include/linux/fcntl.h:161:9: warning: ‘AT_RENAME_WHITEOUT’ redefined
>>   161 | #define AT_RENAME_WHITEOUT      0x0004
>> /usr/include/stdio.h:175:10: note: this is the location of the previous definition
>>   175 | # define AT_RENAME_WHITEOUT RENAME_WHITEOUT
>>
>> for samples/watch_queue/watch_test.c:
>>
>> In file included from usr/include/linux/watch_queue.h:6,
>>                  from ../samples/watch_queue/watch_test.c:19:
>> usr/include/linux/fcntl.h:159:9: warning: ‘AT_RENAME_NOREPLACE’ redefined
>>   159 | #define AT_RENAME_NOREPLACE     0x0001
>> In file included from ../samples/watch_queue/watch_test.c:11:
>> /usr/include/stdio.h:171:10: note: this is the location of the previous definition
>>   171 | # define AT_RENAME_NOREPLACE RENAME_NOREPLACE
>> usr/include/linux/fcntl.h:160:9: warning: ‘AT_RENAME_EXCHANGE’ redefined
>>   160 | #define AT_RENAME_EXCHANGE      0x0002
>> /usr/include/stdio.h:173:10: note: this is the location of the previous definition
>>   173 | # define AT_RENAME_EXCHANGE RENAME_EXCHANGE
>> usr/include/linux/fcntl.h:161:9: warning: ‘AT_RENAME_WHITEOUT’ redefined
>>   161 | #define AT_RENAME_WHITEOUT      0x0004
>> /usr/include/stdio.h:175:10: note: this is the location of the previous definition
>>   175 | # define AT_RENAME_WHITEOUT RENAME_WHITEOUT
>>

>>>
>>> I'm pretty sure C says that duplicate definitions are fine as long
>>> as they're identical.
>> The vales are identical but the strings are not identical.
>>
>> We can't fix stdio.h, but we could just change uapi/linux/fcntl.h
>> to match stdio.h. I suppose.
> 
> I do not specifically object to a patch like this (assuming that is works?):
> 
> --- a/include/uapi/linux/fcntl.h
> +++ b/include/uapi/linux/fcntl.h
> @@ -156,9 +156,9 @@
>   */
> 
>  /* Flags for renameat2(2) (must match legacy RENAME_* flags). */
> -#define AT_RENAME_NOREPLACE    0x0001
> -#define AT_RENAME_EXCHANGE     0x0002
> -#define AT_RENAME_WHITEOUT     0x0004
> +#define AT_RENAME_NOREPLACE    RENAME_NOREPLACE
> +#define AT_RENAME_EXCHANGE     RENAME_EXCHANGE
> +#define AT_RENAME_WHITEOUT     RENAME_WHITEOUT
> 

I'll test that.

> 
> But to be clear, this is a regression introduced by glibc that is likely
> to break many other builds, not only the kernel samples
> and even if we fix linux uapi to conform to its downstream
> copy of definitions, it won't help those users whose programs
> build was broken until they install kernel headers, so feels like you
> should report this regression to glibc and they'd better not "fix" the
> regression by copying the current definition string as that may change as per
> the patch above.
> 

I'll look into that also.

> Why would a library copy definitions from kernel uapi without
> wrapping them with #ifndef or #undef?

To me it looks like they stuck them into the wrong file - stdio.h
instead of fcntl.h.

thanks.
-- 
~Randy


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] uapi/fcntl: conditionally define AT_RENAME* macros
  2025-08-24 23:54   ` Randy Dunlap
  2025-08-25  5:58     ` Amir Goldstein
@ 2025-08-25 13:03     ` Matthew Wilcox
  2025-08-25 17:52       ` Randy Dunlap
  1 sibling, 1 reply; 9+ messages in thread
From: Matthew Wilcox @ 2025-08-25 13:03 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: linux-kernel, Amir Goldstein, Jeff Layton, Chuck Lever,
	Alexander Aring, Josef Bacik, Aleksa Sarai, Jan Kara,
	Christian Brauner, linux-fsdevel, linux-api

On Sun, Aug 24, 2025 at 04:54:50PM -0700, Randy Dunlap wrote:
> In file included from ../samples/vfs/test-statx.c:23:
> usr/include/linux/fcntl.h:159:9: warning: ‘AT_RENAME_NOREPLACE’ redefined
>   159 | #define AT_RENAME_NOREPLACE     0x0001
> In file included from ../samples/vfs/test-statx.c:13:
> /usr/include/stdio.h:171:10: note: this is the location of the previous definition
>   171 | # define AT_RENAME_NOREPLACE RENAME_NOREPLACE

Oh dear.  This is going to be libc-version-dependent.

$ grep -r AT_RENAME_NOREPLACE /usr/include
/usr/include/linux/fcntl.h:#define AT_RENAME_NOREPLACE	0x0001

It's not in stdio.h at all.  This is with libc6 2.41-10

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] uapi/fcntl: conditionally define AT_RENAME* macros
  2025-08-25 13:03     ` Matthew Wilcox
@ 2025-08-25 17:52       ` Randy Dunlap
  2025-08-25 18:45         ` Matthew Wilcox
  0 siblings, 1 reply; 9+ messages in thread
From: Randy Dunlap @ 2025-08-25 17:52 UTC (permalink / raw)
  To: Matthew Wilcox
  Cc: linux-kernel, Amir Goldstein, Jeff Layton, Chuck Lever,
	Alexander Aring, Josef Bacik, Aleksa Sarai, Jan Kara,
	Christian Brauner, linux-fsdevel, linux-api



On 8/25/25 6:03 AM, Matthew Wilcox wrote:
> On Sun, Aug 24, 2025 at 04:54:50PM -0700, Randy Dunlap wrote:
>> In file included from ../samples/vfs/test-statx.c:23:
>> usr/include/linux/fcntl.h:159:9: warning: ‘AT_RENAME_NOREPLACE’ redefined
>>   159 | #define AT_RENAME_NOREPLACE     0x0001
>> In file included from ../samples/vfs/test-statx.c:13:
>> /usr/include/stdio.h:171:10: note: this is the location of the previous definition
>>   171 | # define AT_RENAME_NOREPLACE RENAME_NOREPLACE
> 
> Oh dear.  This is going to be libc-version-dependent.
> 

I am not surprised at that.

> $ grep -r AT_RENAME_NOREPLACE /usr/include
> /usr/include/linux/fcntl.h:#define AT_RENAME_NOREPLACE	0x0001
> 
> It's not in stdio.h at all.  This is with libc6 2.41-10

It was added 2025-04-22:
2025-04-22  Joseph Myers  <josmyers@redhat.com>

	COMMIT: cf9241107d12e79073ddb03bab9de115e5e0e856
	Add AT_* constants from Linux 6.12

$ grep -r AT_RENAME_NOREPLACE /usr/include
/usr/include/stdio.h:# define AT_RENAME_NOREPLACE RENAME_NOREPLACE
/usr/include/linux/fcntl.h:#define AT_RENAME_NOREPLACE	0x0001

I have libc 2.42-1.1 (openSUSE).

thanks.
-- 
~Randy


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] uapi/fcntl: conditionally define AT_RENAME* macros
  2025-08-25 17:52       ` Randy Dunlap
@ 2025-08-25 18:45         ` Matthew Wilcox
  2025-08-25 19:29           ` Randy Dunlap
  0 siblings, 1 reply; 9+ messages in thread
From: Matthew Wilcox @ 2025-08-25 18:45 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: linux-kernel, Amir Goldstein, Jeff Layton, Chuck Lever,
	Alexander Aring, Josef Bacik, Aleksa Sarai, Jan Kara,
	Christian Brauner, linux-fsdevel, linux-api

On Mon, Aug 25, 2025 at 10:52:31AM -0700, Randy Dunlap wrote:
> $ grep -r AT_RENAME_NOREPLACE /usr/include
> /usr/include/stdio.h:# define AT_RENAME_NOREPLACE RENAME_NOREPLACE
> /usr/include/linux/fcntl.h:#define AT_RENAME_NOREPLACE	0x0001
> 
> I have libc 2.42-1.1 (openSUSE).

I wonder if we can fix it by changing include/uapi/linux/fcntl.h
from being an explicit 0x0001 to RENAME_NOREPLACE?  There's probably
a horrendous include problem between linux/fcntl.h and linux/fs.h
though?

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] uapi/fcntl: conditionally define AT_RENAME* macros
  2025-08-25 18:45         ` Matthew Wilcox
@ 2025-08-25 19:29           ` Randy Dunlap
  0 siblings, 0 replies; 9+ messages in thread
From: Randy Dunlap @ 2025-08-25 19:29 UTC (permalink / raw)
  To: Matthew Wilcox
  Cc: linux-kernel, Amir Goldstein, Jeff Layton, Chuck Lever,
	Alexander Aring, Josef Bacik, Aleksa Sarai, Jan Kara,
	Christian Brauner, linux-fsdevel, linux-api



On 8/25/25 11:45 AM, Matthew Wilcox wrote:
> On Mon, Aug 25, 2025 at 10:52:31AM -0700, Randy Dunlap wrote:
>> $ grep -r AT_RENAME_NOREPLACE /usr/include
>> /usr/include/stdio.h:# define AT_RENAME_NOREPLACE RENAME_NOREPLACE
>> /usr/include/linux/fcntl.h:#define AT_RENAME_NOREPLACE	0x0001
>>
>> I have libc 2.42-1.1 (openSUSE).
> 
> I wonder if we can fix it by changing include/uapi/linux/fcntl.h
> from being an explicit 0x0001 to RENAME_NOREPLACE?  There's probably
> a horrendous include problem between linux/fcntl.h and linux/fs.h
> though?

I'm working on something like that now (suggested by Amir),
but it might depend on whether stdio.h has been #included first.

-- 
~Randy


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2025-08-25 19:29 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-24 22:10 [PATCH] uapi/fcntl: conditionally define AT_RENAME* macros Randy Dunlap
2025-08-24 23:21 ` Matthew Wilcox
2025-08-24 23:54   ` Randy Dunlap
2025-08-25  5:58     ` Amir Goldstein
2025-08-25  6:49       ` Randy Dunlap
2025-08-25 13:03     ` Matthew Wilcox
2025-08-25 17:52       ` Randy Dunlap
2025-08-25 18:45         ` Matthew Wilcox
2025-08-25 19:29           ` Randy Dunlap

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).