From: Cyril Hrubis <chrubis@suse.cz>
To: Petr Vorel <pvorel@suse.cz>
Cc: ltp@lists.linux.it, Chen Hanxiao <chenhx.fnst@cn.fujitsu.com>
Subject: Re: [LTP] [PATCH v2] syscalls/mount_setattr01: Add basic functional test
Date: Thu, 21 Apr 2022 11:13:57 +0200 [thread overview]
Message-ID: <YmEgVS3DBARBkYOx@yuki> (raw)
In-Reply-To: <YmBwWqS0GEuwnb/d@pevik>
Hi!
> > +struct mount_attr {
> > + uint64_t attr_set;
> > + uint64_t attr_clr;
> > + uint64_t propagation;
> > + uint64_t userns_fd;
> > +};
> Interesting enough: in kernel tools/testing/selftests/mount_setattr/mount_setattr_test.c
> defines it as __u64 (IMHO should be really uint64_t as that test is userspace as
> Cyril pointed out) but real kernel code in fs/namespace.c happily uses "unsigned
> int" :).
You are just confused by the fact that there are two different
structures there is mount_attr and mount_kattr, the mount_setattr()
syscall gets the mount_attr from userspace and then fills in mount_kattr
based on that. See the function build_mount_kattr() in fs/namespace.c
I guess that this is simply done so that there is enough space for flags
to be added in the future without a need to change the structure.
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2022-04-21 9:11 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-20 10:29 [LTP] [PATCH v2] syscalls/mount_setattr01: Add basic functional test Chen Hanxiao
2022-04-20 20:43 ` Petr Vorel
2022-04-21 9:13 ` Cyril Hrubis [this message]
2022-04-21 9:14 ` Petr Vorel
2022-04-22 11:05 ` [LTP] 回复: " chenhx.fnst
2022-04-22 14:11 ` Petr Vorel
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=YmEgVS3DBARBkYOx@yuki \
--to=chrubis@suse.cz \
--cc=chenhx.fnst@cn.fujitsu.com \
--cc=ltp@lists.linux.it \
--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