diff mbox series

[V3] uapi: Fixup strace compile error

Message ID 20230324073630.161034-1-guoren@kernel.org (mailing list archive)
State Handled Elsewhere
Headers show
Series [V3] uapi: Fixup strace compile error | expand

Checks

Context Check Description
conchuod/cover_letter success Single patches do not need cover letters
conchuod/tree_selection success Guessed tree name to be for-next
conchuod/fixes_present success Fixes tag not required for -next series
conchuod/maintainers_pattern success MAINTAINERS pattern errors before the patch: 1 and now 1
conchuod/verify_signedoff success Signed-off-by tag matches author and committer
conchuod/kdoc success Errors and warnings before: 0 this patch: 0
conchuod/build_rv64_clang_allmodconfig success Errors and warnings before: 2262 this patch: 2262
conchuod/module_param success Was 0 now: 0
conchuod/build_rv64_gcc_allmodconfig success Errors and warnings before: 17567 this patch: 17567
conchuod/build_rv32_defconfig success Build OK
conchuod/dtb_warn_rv64 success Errors and warnings before: 3 this patch: 3
conchuod/header_inline success No static functions without inline keyword in header files
conchuod/checkpatch warning WARNING: Please use correct Fixes: style 'Fixes: <12 chars of sha1> ("<title line>")' - ie: 'Fixes: 6c425cdc5590 ("uapi: Fixup strace compile error")' WARNING: Reported-by: should be immediately followed by Link: with a URL to the report
conchuod/source_inline success Was 0 now: 0
conchuod/build_rv64_nommu_k210_defconfig success Build OK
conchuod/verify_fixes success Fixes tag looks correct
conchuod/build_rv64_nommu_virt_defconfig success Build OK

Commit Message

Guo Ren March 24, 2023, 7:36 a.m. UTC
From: Guo Ren <guoren@linux.alibaba.com>

Export F_*64 definitions to userspace permanently. "ifndef" usage made it
vailable at all times to the userspace, and this change has actually broken
building strace with the latest kernel headers. There could be some debate
whether having these F_*64 definitions exposed to the user space 64-bit
applications, but it seems that were no harm (as they were exposed already
for quite some time), and they are useful at least for strace for compat
application tracing purposes.

Here is the compile error log:
../../../src/xlat/fcntlcmds.h:54:7: error: ‘F_GETLK64’ undeclared here
(not in a function); did you mean ‘F_GETLK’?
   54 |  XLAT(F_GETLK64),
      |       ^~~~~~~~~
../../../src/xlat.h:64:54: note: in definition of macro ‘XLAT’
   64 | # define XLAT(val)                      { (unsigned)(val), #val
      }
      |                                                      ^~~
../../../src/xlat/fcntlcmds.h:57:7: error: ‘F_SETLK64’ undeclared here
(not in a function); did you mean ‘F_SETLK’?
   57 |  XLAT(F_SETLK64),
      |       ^~~~~~~~~
../../../src/xlat.h:64:54: note: in definition of macro ‘XLAT’
   64 | # define XLAT(val)                      { (unsigned)(val), #val
      }
      |                                                      ^~~
../../../src/xlat/fcntlcmds.h:60:7: error: ‘F_SETLKW64’ undeclared here
(not in a function); did you mean ‘F_SETLKW’?
   60 |  XLAT(F_SETLKW64),
      |       ^~~~~~~~~~
../../../src/xlat.h:64:54: note: in definition of macro ‘XLAT’
   64 | # define XLAT(val)                      { (unsigned)(val), #val
      }

Fixes: 306f7cc1e9061 "uapi: always define F_GETLK64/F_SETLK64/F_SETLKW64 in fcntl.h"
Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
Signed-off-by: Guo Ren <guoren@kernel.org>
Reported-by: Eugene Syromiatnikov <esyr@redhat.com>
Acked-by: Palmer Dabbelt <palmer@rivosinc.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Heiko Stuebner <heiko@sntech.de>
---
Changelog
v3:
 - Add error log

v2:
https://lore.kernel.org/lkml/20220804025448.1240780-1-guoren@kernel.org/
 - Optimize commit log

v1:
https://lore.kernel.org/lkml/20220613013051.1741434-1-guoren@kernel.org/
---
 include/uapi/asm-generic/fcntl.h | 2 --
 1 file changed, 2 deletions(-)

Comments

Christoph Hellwig March 26, 2023, 10:03 p.m. UTC | #1
Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>
diff mbox series

Patch

diff --git a/include/uapi/asm-generic/fcntl.h b/include/uapi/asm-generic/fcntl.h
index 1ecdb911add8..3a389895328a 100644
--- a/include/uapi/asm-generic/fcntl.h
+++ b/include/uapi/asm-generic/fcntl.h
@@ -116,13 +116,11 @@ 
 #define F_GETSIG	11	/* for sockets. */
 #endif
 
-#if __BITS_PER_LONG == 32 || defined(__KERNEL__)
 #ifndef F_GETLK64
 #define F_GETLK64	12	/*  using 'struct flock64' */
 #define F_SETLK64	13
 #define F_SETLKW64	14
 #endif
-#endif /* __BITS_PER_LONG == 32 || defined(__KERNEL__) */
 
 #ifndef F_SETOWN_EX
 #define F_SETOWN_EX	15