From: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v2] syscalls/statx04: use stx_attributes_mask before test
Date: Wed, 28 Aug 2019 11:56:37 +0800 [thread overview]
Message-ID: <5D65FB75.6070800@cn.fujitsu.com> (raw)
In-Reply-To: <20190827092520.GA28859@dell5510>
on 2019/08/27 17:25, Petr Vorel wrote:
> Hi Yang,
>
>> stx_attributes_mask shows what's supported in stx_attributes.
>> we should check four attrbutes whether supports on tested filesystem
> typo attrbutes
>> and only test supported flags on tested filesystem.
> I'd change it to
> Set supp_{append,compr,immutable,nodump} attributes only on filesystems which
> actually support them.
>
>> Signed-off-by: Yang Xu<xuyang2018.jy@cn.fujitsu.com>
> Reviewed-by: Petr Vorel<pvorel@suse.cz>
Hi Petr
Thanks for your review.
>> ---
>> testcases/kernel/syscalls/statx/statx04.c | 124 ++++++++++++++++------
> ...
>
>> - attr |= FS_COMPR_FL | FS_APPEND_FL | FS_IMMUTABLE_FL | FS_NODUMP_FL;
>> + if (supp_compr)
>> + attr |= FS_COMPR_FL;
>> + if (supp_append)
>> + attr |= FS_APPEND_FL;
>> + if (supp_immutable)
>> + attr |= FS_IMMUTABLE_FL;
>> + if (supp_nodump)
>> + attr |= FS_NODUMP_FL;
>> ret = ioctl(fd, FS_IOC_SETFLAGS,&attr);
>> if (ret< 0) {
>> @@ -149,12 +176,43 @@ static void caid_flags_setup(void)
> Current code...
> if (supp_append)
> attr |= FS_APPEND_FL;
> if (supp_compr)
> attr |= FS_COMPR_FL;
> if (supp_immutable)
> attr |= FS_IMMUTABLE_FL;
> if (supp_nodump)
> attr |= FS_NODUMP_FL;
>
> ret = ioctl(fd, FS_IOC_SETFLAGS,&attr);
> if (ret< 0) {
> I wonder, if this check is still needed. Probably it's still useful to have
> sanity check, but "Flags not supported" has been caught
> by supp_{append,compr,immutable,nodump} variables.
It seems this check is redundant. In principle, if attributes_mask support these flags, the attribute should also
support them. Even though xfs filesystem missed attributes_mask after[1] and doesn't add it until [2]. But we don't
have the situation of having attribute_mask but not having attribute. So I think we can remove it.
[1]https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=5f955f26f3d42d
[2]https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=1b9598c8fb9965
Thanks
Yang Xu
> if (errno == EOPNOTSUPP)
> tst_brk(TCONF, "Flags not supported");
> tst_brk(TBROK | TERRNO, "ioctl(%i, FS_IOC_SETFLAGS, %i)", fd, attr);
> }
> ...
>
> Kind regards,
> Petr
>
>
> .
>
prev parent reply other threads:[~2019-08-28 3:56 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-02 10:34 [LTP] [PATCH] syscalls/statx04: use stx_attributes_mask before test Yang Xu
2019-08-02 11:50 ` Cyril Hrubis
2019-08-20 6:33 ` [LTP] [PATCH v2] " Yang Xu
2019-08-27 9:25 ` Petr Vorel
2019-08-27 9:58 ` Petr Vorel
2019-08-27 10:16 ` Cyril Hrubis
2019-09-11 10:22 ` =?unknown-8bit?b?WWFuZy/lvpAg5p2o?=
2019-09-11 12:47 ` Cyril Hrubis
2019-09-12 3:28 ` =?unknown-8bit?b?WWFuZy/lvpAg5p2o?=
2019-10-25 3:53 ` [LTP] [PATCH] " Yang Xu
2019-10-31 10:03 ` Yang Xu
2021-05-25 13:18 ` Li Wang
2021-05-25 14:16 ` Cyril Hrubis
2021-05-26 4:00 ` xuyang2018.jy
2021-05-26 8:31 ` Li Wang
2021-05-26 10:02 ` xuyang2018.jy
2021-11-10 13:28 ` Richard Palethorpe
2021-11-11 3:25 ` xuyang2018.jy
2019-08-28 3:56 ` Yang Xu [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=5D65FB75.6070800@cn.fujitsu.com \
--to=xuyang2018.jy@cn.fujitsu.com \
--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