Thread (5 messages) 5 messages, 3 authors, 2025-09-05

Re: [PATCH v3] uapi/linux/fcntl: remove AT_RENAME* macros

From: Randy Dunlap <hidden>
Date: 2025-09-04 21:51:15
Also in: linux-fsdevel, linux-patches


On 9/4/25 11:17 AM, Amir Goldstein wrote:
On Thu, Sep 4, 2025 at 8:22 AM Randy Dunlap [off-list ref] wrote:
quoted
Don't define the AT_RENAME_* macros at all since the kernel does not
use them nor does the kernel need to provide them for userspace.
Leave them as comments in <uapi/linux/fcntl.h> only as an example.

The AT_RENAME_* macros have recently been added to glibc's <stdio.h>.
For a kernel allmodconfig build, this made the macros be defined
differently in 2 places (same values but different macro text),
causing build errors/warnings (duplicate definitions) in both
samples/watch_queue/watch_test.c and samples/vfs/test-statx.c.
(<linux/fcntl.h> is included indirecty in both programs above.)

Fixes: b4fef22c2fb9 ("uapi: explain how per-syscall AT_* flags should be allocated")
Signed-off-by: Randy Dunlap <redacted>
---
Cc: Amir Goldstein <amir73il@gmail.com>
Cc: Jeff Layton <jlayton@kernel.org>
Cc: Chuck Lever <redacted>
Cc: Alexander Aring <alex.aring@gmail.com>
Cc: Josef Bacik <josef@toxicpanda.com>
Cc: Aleksa Sarai <redacted>
Cc: Jan Kara <jack@suse.cz>
Cc: Christian Brauner <brauner@kernel.org>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: David Howells <dhowells@redhat.com>
CC: linux-api@vger.kernel.org
To: linux-fsdevel@vger.kernel.org
---
 include/uapi/linux/fcntl.h |    6 ++++++
 1 file changed, 6 insertions(+)
--- linux-next-20250819.orig/include/uapi/linux/fcntl.h
+++ linux-next-20250819/include/uapi/linux/fcntl.h
@@ -155,10 +155,16 @@
  * as possible, so we can use them for generic bits in the future if necessary.
  */

+/*
+ * Note: This is an example of how the AT_RENAME_* flags could be defined,
+ * but the kernel has no need to define them, so leave them as comments.
+ */
 /* Flags for renameat2(2) (must match legacy RENAME_* flags). */
+/*
 #define AT_RENAME_NOREPLACE    0x0001
 #define AT_RENAME_EXCHANGE     0x0002
 #define AT_RENAME_WHITEOUT     0x0004
+*/
I find this end result a bit odd, but I don't want to suggest another variant
I already proposed one in v2 review [1] that maybe you did not like.
It's fine.
Yes, I replied to that with another problem.
I'll let Aleksa and Christian chime in to decide on if and how they want this
comment to look or if we should just delete these definitions and be done with
this episode.
Sure, I'm ready to just throw my hands up (give up).
Thanks,
Amir.

[1] https://lore.kernel.org/r/CAOQ4uxjXvYBsW1Nb2HKaoUg1qi8Pkq1XKtQEbnAvMUGcp7LrZA@mail.gmail.com/ (local)
thanks.
-- 
~Randy
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help