From: Petr Vorel <pvorel@suse.cz>
To: Andrea Cervesato <andrea.cervesato@suse.de>
Cc: Linux Test Project <ltp@lists.linux.it>
Subject: Re: [LTP] [PATCH v3] syscalls: add file_attr05 test
Date: Tue, 20 Jan 2026 13:43:23 +0100 [thread overview]
Message-ID: <20260120124323.GA39038@pevik> (raw)
In-Reply-To: <20260120-file_attr05-v3-1-c3fd9fc0fcce@suse.com>
Hi Andrea,
> From: Andrea Cervesato <andrea.cervesato@suse.com>
> Verify that `file_setattr` is correctly raising EOPNOTSUPP when
> filesystem doesn't support FSX operations.
> Regression test for "474b155adf39 - fs: make vfs_fileattr_[get|set]
> return -EOPNOTSUPP".
Reason for changing approach in v3:
https://lore.kernel.org/ltp/DFTCS1EEBMDD.21X779ISM0MTF@suse.com/
> +++ b/testcases/kernel/syscalls/file_attr/file_attr05.c
> @@ -0,0 +1,63 @@
> +// SPDX-License-Identifier: GPL-2.0-or-later
> +/*
> + * Copyright (C) 2025 SUSE LLC Andrea Cervesato <andrea.cervesato@suse.com>
> + */
> +
> +/*\
> + * Verify that `file_setattr` is correctly raising EOPNOTSUPP when filesystem
> + * doesn't support FSX operations.
> + *
> + * Regression test for "474b155adf39 - fs: make vfs_fileattr_[get|set] return
> + * -EOPNOTSUPP".
Why not added into .tags?
nit: Also the usual way of referring commits is:
474b155adf392 ("fs: make vfs_fileattr_[get|set] return -EOPNOTSUPP")
> + */
> +
> +#include "tst_test.h"
> +#include "lapi/fs.h"
> +
> +#define MNTPOINT "mntpoint"
> +#define FILEPATH (MNTPOINT "/ltp_file")
> +#define BLOCKS 128
> +#define PROJID 16
> +
> +static struct file_attr *attr_set;
> +
> +static void run(void)
> +{
> + TST_EXP_FAIL(file_setattr(AT_FDCWD, FILEPATH,
> + attr_set, FILE_ATTR_SIZE_LATEST, 0), EOPNOTSUPP);
> +}
> +
> +static void setup(void)
> +{
> + struct stat statbuf;
> +
> + SAFE_TOUCH(FILEPATH, 0777, NULL);
> +
> + SAFE_STAT(MNTPOINT, &statbuf);
> +
> + attr_set->fa_xflags |= FS_XFLAG_EXTSIZE;
> + attr_set->fa_xflags |= FS_XFLAG_COWEXTSIZE;
> + attr_set->fa_extsize = BLOCKS * statbuf.st_blksize;
> + attr_set->fa_cowextsize = BLOCKS * statbuf.st_blksize;
> + attr_set->fa_projid = PROJID;
> +}
> +
> +static struct tst_test test = {
> + .test_all = run,
> + .setup = setup,
> + .mntpoint = MNTPOINT,
> + .needs_root = 1,
> + .mount_device = 1,
> + .all_filesystems = 1,
> + .format_device = 1,
> + .skip_filesystems = (const char *const []) {
> + "xfs",
> + "fuse", /* EINVAL is raised before EOPNOTSUPP */
> + "vfat", /* vfat is not implementing file_[set|get]attr */
Hm, funny, vfat not implementing also raises EOPNOTSUPP. I wonder if we should
keep it as well.
> + NULL,
> + },
> + .bufs = (struct tst_buffers []) {
> + {&attr_set, .size = sizeof(struct file_attr)},
Again, I'd put 474b155adf392 into tags. It's IMHO enough (no need for mentioning
it in the docs.
Kind regards,
Petr
> + {}
> + }
> +};
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2026-01-20 12:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-20 10:51 [LTP] [PATCH v3] syscalls: add file_attr05 test Andrea Cervesato
2026-01-20 12:43 ` Petr Vorel [this message]
2026-01-20 13:22 ` Andrea Cervesato via ltp
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260120124323.GA39038@pevik \
--to=pvorel@suse.cz \
--cc=andrea.cervesato@suse.de \
--cc=ltp@lists.linux.it \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox