All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: Cyril Hrubis <chrubis@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:14:02 +0200	[thread overview]
Message-ID: <YmEgWnz8Sr1jiYPT@pevik> (raw)
In-Reply-To: <YmEgVS3DBARBkYOx@yuki>

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

Ah, thx for info.

Kind regards,
Petr

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

  reply	other threads:[~2022-04-21  9:14 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
2022-04-21  9:14     ` Petr Vorel [this message]
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=YmEgWnz8Sr1jiYPT@pevik \
    --to=pvorel@suse.cz \
    --cc=chenhx.fnst@cn.fujitsu.com \
    --cc=chrubis@suse.cz \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.