Skip to content

Commit

Permalink
kernel/sys_ni: add compat entry for fadvise64_64
Browse files Browse the repository at this point in the history
When CONFIG_ADVISE_SYSCALLS is not set/enabled and CONFIG_COMPAT is
set/enabled, the riscv compat_syscall_table references
'compat_sys_fadvise64_64', which is not defined:

riscv64-linux-ld: arch/riscv/kernel/compat_syscall_table.o:(.rodata+0x6f8):
undefined reference to `compat_sys_fadvise64_64'

Add 'fadvise64_64' to kernel/sys_ni.c as a conditional COMPAT function so
that when CONFIG_ADVISE_SYSCALLS is not set, there is a fallback function
available.

Link: https://lkml.kernel.org/r/[email protected]
Fixes: d3ac21c ("mm: Support compiling out madvise and fadvise")
Signed-off-by: Randy Dunlap <[email protected]>
Suggested-by: Arnd Bergmann <[email protected]>
Reviewed-by: Arnd Bergmann <[email protected]>
Cc: Josh Triplett <[email protected]>
Cc: Paul Walmsley <[email protected]>
Cc: Palmer Dabbelt <[email protected]>
Cc: Albert Ou <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
  • Loading branch information
rddunlap authored and akpm00 committed Aug 20, 2022
1 parent 5535be3 commit a8faed3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions kernel/sys_ni.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ COND_SYSCALL(landlock_restrict_self);

/* mm/fadvise.c */
COND_SYSCALL(fadvise64_64);
COND_SYSCALL_COMPAT(fadvise64_64);

/* mm/, CONFIG_MMU only */
COND_SYSCALL(swapon);
Expand Down

0 comments on commit a8faed3

Please sign in to comment.