From: Petr Vorel <pvorel@suse.cz>
To: Martin Doucha <mdoucha@suse.cz>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v2] Rewrite statx04 test
Date: Wed, 19 Jan 2022 12:23:00 +0100 [thread overview]
Message-ID: <Yef0lBQ5aryeC5ew@pevik> (raw)
In-Reply-To: <20220119111533.8356-1-mdoucha@suse.cz>
Hi Martin,
> statx04 is supposed verify that inode attribute support in statx() matches
> what should actually be implemented. However, we already have functional tests
> for this in statx08 and lack a test of the stx_attribute_mask field which
> reports inode attribute support to userspace.
> Rewrite the test to drop the duplicate code and add the missing coverage.
> Signed-off-by: Martin Doucha <mdoucha@suse.cz>
> ---
> Changes since v1:
> - added known-fail tag for XFS in strict mode
> - changed copyright header to SUSE since this is a near-complete rewrite
Thanks a lot!
> This also fixes Btrfs failures on kernels v4.11 and v4.12 where the attributes
> are not supported at all. LTP is supposed to check for bugs, not force people
> to backport features from newer kernels.
> If anybody want to backport the Btrfs support, the test now has strict mode
> which disables kernel version exceptions.
> I've also disabled FUSE filesystems because they return wrong errno codes
> in the ioctl() check and NTFS3g now has some rudimentary support for inode
> attributes but no support for them in statx().
I'd put this into commit message (can be done during merge).
...
> + if (TST_RET)
> + tst_brk(TBROK | TTERRNO, "Unexpected ioctl() error");
> -static void test_unflagged(void)
> -{
> - struct statx buf;
> + for (i = 0, expected_mask = 0; i < ARRAY_SIZE(attr_list); i++)
Before merge we should cast to prevent "comparison of integer expressions of
different signedness" warning:
for (i = 0, expected_mask = 0; i < (int)ARRAY_SIZE(attr_list); i++)
> + expected_mask |= attr_list[i].attr;
...
> -static void setup(void)
> -{
> - SAFE_MKDIR(TESTDIR_FLAGGED, 0777);
> - SAFE_MKDIR(TESTDIR_UNFLAGGED, 0777);
> + for (i = 0; i < ARRAY_SIZE(attr_list); i++) {
And here:
for (i = 0; i < (int)ARRAY_SIZE(attr_list); i++) {
> + if (!(expected_mask & attr_list[i].attr))
> + continue;
Reviewed-by: Petr Vorel <pvorel@suse.cz>
Kind regards,
Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2022-01-19 11:23 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-19 11:15 [LTP] [PATCH v2] Rewrite statx04 test Martin Doucha
2022-01-19 11:23 ` Petr Vorel [this message]
2022-01-19 11:28 ` Martin Doucha
2022-01-19 11:45 ` Petr Vorel
2022-01-19 15:52 ` Cyril Hrubis
2022-01-20 7:18 ` Li Wang
2022-01-20 7:30 ` Li Wang
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=Yef0lBQ5aryeC5ew@pevik \
--to=pvorel@suse.cz \
--cc=ltp@lists.linux.it \
--cc=mdoucha@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