public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Andrea Cervesato via ltp <ltp@lists.linux.it>
To: "Petr Vorel" <pvorel@suse.cz>,
	"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 14:22:41 +0100	[thread overview]
Message-ID: <DFTG5UGY0U63.3DAYYGFYK110X@suse.com> (raw)
In-Reply-To: <20260120124323.GA39038@pevik>

On Tue Jan 20, 2026 at 1:43 PM CET, Petr Vorel wrote:
> 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.

It makes sense from the point of view of the results, but it doesn't
make sense from the point of view of the test's meaning. EOPNOTSUPP in
case of vfat is raised for other reasons.

>
> > +		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.

Sorry I forgot, I'm going to send a v4.


-- 
Andrea Cervesato
SUSE QE Automation Engineer Linux
andrea.cervesato@suse.com


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

      reply	other threads:[~2026-01-20 13:23 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
2026-01-20 13:22   ` Andrea Cervesato via ltp [this message]

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=DFTG5UGY0U63.3DAYYGFYK110X@suse.com \
    --to=ltp@lists.linux.it \
    --cc=andrea.cervesato@suse.com \
    --cc=andrea.cervesato@suse.de \
    --cc=pvorel@suse.cz \
    /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