[LTP] [PATCH v6 4/5] Add fchmodat2_01 test

Petr Vorel pvorel@suse.cz
Fri Aug 2 13:35:46 CEST 2024


> From: Andrea Cervesato <andrea.cervesato@suse.com>

> This test verifies that fchmodat2() syscall is properly working with
> AT_SYMLINK_NOFOLLOW on regular files. When AT_SYMLINK_NOFOLLOW is used
> on symbolic links instead, we check for EOPNOTSUPP, since the feature is
> not implemented for VFS.
nit: I would replace "not implemented for VFS" with:

creating symlink is *blocked* by VFS since kernel commit 5d1f903f75a8
(previously it was never supposed to be supported by filesystems, there was a
series of bugs that lead to it working by accident on some filesystems)

> +++ b/testcases/kernel/syscalls/fchmodat2/fchmodat2_01.c
> @@ -0,0 +1,117 @@
> +// SPDX-License-Identifier: GPL-2.0-or-later
> +/*
> + * Copyright (C) 2024 SUSE LLC Andrea Cervesato <andrea.cervesato@suse.com>
> + */
> +
> +/*\
> + * [Description]
> + *
> + * This test verifies that fchmodat2() syscall is properly working with
> + * regular files, symbolic links and directories. AT_SYMLINK_NOFOLLOW is a
> + * special feature that is not enabled in VFS for symbolic links since
nit: maybe s/ enabled/blocked/
> + * (introduced by 5d1f903f75a8), so we only verify that EOPNOTSUPP is correctly
> + * raised when used on those particular files.
> + */

Feel free to merge whole patchset :).

Kind regards,
Petr


More information about the ltp mailing list