[LTP] [PATCH v5 7/7] Add file_attr04 test

Cyril Hrubis chrubis@suse.cz
Wed Aug 6 16:23:05 CEST 2025


Hi!
> +/*\
> + * Verify that `file_getattr` and `file_setattr` are correctly raising an error
> + * when the wrong file descriptors types are passed to them.
> + */
> +
> +#include "tst_test.h"
> +#include "lapi/fs.h"
> +
> +#define FILENAME "ltp_file"
> +
> +static struct file_attr *attr;
> +
> +static void test_invalid_fd(struct tst_fd *fd)
> +{
> +	if (fd->type == TST_FD_DIR || fd->type == TST_FD_OPEN_TREE) {

Just curious, does the fd from open_tree() work fine as dirfd or do we
just get differnt errno? I think second one may be the case, since the
file descriptor from open_tree() syscall usually behaves a bit strange.

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list