[PATCH v4 15/19] selftests/liveupdate: Add a test for retrieving tmpfs files

sashiko-bot at kernel.org sashiko-bot at kernel.org
Wed Nov 11 16:31:27 PST 2026


Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] selftests/liveupdate: do_fcntl() breaks build on 32-bit generic
  unistd archs
--

commit 0645310fa3a030d5078797e4ea9657a80cb11ec5
Author: David Matlack <dmatlack at google.com>

selftests/liveupdate: Add a test for retrieving tmpfs files

This commit adds luo_tmpfs, a kexec test for preserving tmpfs files and
retrieving them into a file on a tmpfs mount.

> diff --git a/tools/testing/selftests/liveupdate/luo_tmpfs.c b/tools/testing/selftests/liveupdate/luo_tmpfs.c
> new file mode 100644
> index 0000000000000..4e6e035e84339
> --- /dev/null
> +++ b/tools/testing/selftests/liveupdate/luo_tmpfs.c
> @@ -0,0 +1,728 @@

[ ... ]

> +/* nolibc doesn't have these, so use syscall() where needed. */
> +static int do_fcntl(int fd, int cmd, long arg)
> +{
> +	return syscall(__NR_fcntl, fd, cmd, arg);
> +}
> +
> +static int do_mount(const char *source, const char *target, const char *type,
> +		    unsigned long flags, const char *data)
> +{
> +	return syscall(__NR_mount, source, target, type, flags, data);
> +}
> +
> +static int do_statfs(const char *path, struct statfs *buf)
> +{
> +#ifdef NOLIBC
> +	return syscall(__NR_statfs, path, buf);
> +#else
> +	return statfs(path, buf);
> +#endif
> +}

[Severity: Low]
Does calling syscall(__NR_fcntl, ...) unconditionally in do_fcntl() break
kselftest builds on 32-bit architectures that use
include/uapi/asm-generic/unistd.h (such as 32-bit RISC-V)?

Those architectures only define __NR_fcntl64 and __NR_statfs64, not
__NR_fcntl or __NR_statfs.  Should do_fcntl() guard the raw syscall with
#ifdef NOLIBC and call libc fcntl() otherwise, matching do_statfs() right
below it?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261111002358.1842967-1-dmatlack@google.com?part=15



More information about the kexec mailing list