diff options
| author | Zhangjin Wu <[email protected]> | 2023-07-08 02:40:08 +0800 |
|---|---|---|
| committer | Willy Tarreau <[email protected]> | 2023-08-23 04:38:02 +0200 |
| commit | 6861b1a3398ec3f1b830d7d190a6ffbc3be8ab6b (patch) | |
| tree | 5d49482d0094f2fe4978e9850a4174a265740a3b /tools/perf/scripts/python | |
| parent | bbb14546bd22b1c41af7182d085abe89ae21eecd (diff) | |
selftests/nolibc: vfprintf: remove MEMFD_CREATE dependency
The vfprintf test case require to open a temporary file to write, the
old memfd_create() method is perfect but has strong dependency on
MEMFD_CREATE and also TMPFS or HUGETLBFS (see fs/Kconfig):
config MEMFD_CREATE
def_bool TMPFS || HUGETLBFS
And from v6.2, MFD_NOEXEC_SEAL must be passed for the non-executable
memfd, otherwise, The kernel warning will be output to the test result
like this:
Running test 'vfprintf'
0 emptymemfd_create() without MFD_EXEC nor MFD_NOEXEC_SEAL, pid=1 'init'
"" = "" [OK]
To avoid such warning and also to remove the MEMFD_CREATE dependency,
let's open a file from tmpfs directly.
The /tmp directory is used to detect the existing of tmpfs, if not
there, skip instead of fail.
And further, for pid == 1, the initramfs is loaded as ramfs, which can
be used as tmpfs, so, it is able to further remove TMPFS dependency too.
Suggested-by: Thomas Weißschuh <[email protected]>
Link: https://lore.kernel.org/lkml/[email protected]
Reviewed-by: Thomas Weißschuh <[email protected]>
Signed-off-by: Zhangjin Wu <[email protected]>
Signed-off-by: Willy Tarreau <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions