From: Petr Vorel <pvorel@suse.cz>
To: Hongli Li <hongli.li@intel.com>
Cc: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>,
ltp@lists.linux.it, Zhenghao Niu <zhenghaox.niu@intel.com>
Subject: Re: [LTP] [PATCH] statx08: Skip FS_COMPR_FL if it can't be set
Date: Fri, 4 Dec 2026 15:59:44 +0100 [thread overview]
Message-ID: <20261204145944.GA313272@pevik> (raw)
In-Reply-To: <20261204093927.673808-1-hongli.li@intel.com>
Hi all,
> stx_attributes_mask only tells that an attribute can be reported, not
> that it can be set with FS_IOC_SETFLAGS.
> Since commit 33f29fc7c67e ("fs/ntfs3: add fileattr support") in v7.2,
> ntfs3 reports STATX_ATTR_COMPRESSED in stx_attributes_mask, but its
> fileattr_set() rejects FS_COMPR_FL with EOPNOTSUPP:
> statx08.c:115: TBROK: ioctl(3, FS_IOC_SETFLAGS, 52): EOPNOTSUPP (95)
> This also stops the .all_filesystems loop before tmpfs is tested.
> On EOPNOTSUPP, drop FS_COMPR_FL and retry.
First, thanks for catching this!
> Tested-by: Zhenghao Niu <zhenghaox.niu@intel.com>
> Signed-off-by: Hongli Li <hongli.li@intel.com>
> ---
> testcases/kernel/syscalls/statx/statx08.c | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
> diff --git a/testcases/kernel/syscalls/statx/statx08.c b/testcases/kernel/syscalls/statx/statx08.c
> index caced5d3d7..28fc2be148 100644
> --- a/testcases/kernel/syscalls/statx/statx08.c
> +++ b/testcases/kernel/syscalls/statx/statx08.c
> @@ -111,6 +111,19 @@ static void caid_flags_setup(void)
> attr |= FS_NODUMP_FL;
> ret = ioctl(fd, FS_IOC_SETFLAGS, &attr);
> +
> + /* e.g. ntfs3 reports FS_COMPR_FL but can't set it */
> + if (ret < 0 && errno == EOPNOTSUPP && supp_compr) {
> + tst_res(TCONF, "filesystem can't set FS_COMPR_FL");
> + supp_compr = 0;
> + attr &= ~FS_COMPR_FL;
> +
> + if (!(supp_append || supp_immutable || supp_nodump))
> + tst_brk(TCONF, "no other attr to test, skip it");
Wouldn't be better if the function return int and tst_brk was handled in
setup()? I'd prefer to have tst_brk(TCONF) on single place.
Kind regards,
Petr
> +
> + ret = ioctl(fd, FS_IOC_SETFLAGS, &attr);
> + }
> +
> if (ret < 0)
> tst_brk(TBROK | TERRNO, "ioctl(%i, FS_IOC_SETFLAGS, %i)", fd, attr);
--
Mailing list info: https://lists.linux.it/listinfo/ltp
parent reply other threads:[~2026-12-04 15:00 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <20261204093927.673808-1-hongli.li@intel.com>]
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=20261204145944.GA313272@pevik \
--to=pvorel@suse.cz \
--cc=almaz.alexandrovich@paragon-software.com \
--cc=hongli.li@intel.com \
--cc=ltp@lists.linux.it \
--cc=zhenghaox.niu@intel.com \
/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