* [PATCH] samples: fix missing nodiratime option and handle propagate_from correctly
@ 2024-11-21 14:39 Jeff Layton
2024-11-22 11:18 ` Christian Brauner
0 siblings, 1 reply; 2+ messages in thread
From: Jeff Layton @ 2024-11-21 14:39 UTC (permalink / raw)
To: Christian Brauner, Al Viro, Jan Kara
Cc: linux-fsdevel, linux-kernel, Jeff Layton
The nodiratime option is not currently shown. Also, the test for when
to display propagate_from: is incorrect. Make it work like it does in
show_mountinfo().
Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
It might be best to just squash this patch into the one that adds the
new sample program. Also, looks like your vfs-6.14.misc branch hasn't
been updated yet?
---
samples/vfs/mountinfo.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/samples/vfs/mountinfo.c b/samples/vfs/mountinfo.c
index d9f21113a93b7aa7606de2edfce5ad0d5bcf2056..349aaade4de53912b96eadb35bf1b7457b4b04fa 100644
--- a/samples/vfs/mountinfo.c
+++ b/samples/vfs/mountinfo.c
@@ -90,6 +90,8 @@ static void show_mnt_attrs(uint64_t flags)
break;
}
+ if (flags & MOUNT_ATTR_NODIRATIME)
+ printf(",nodiratime");
if (flags & MOUNT_ATTR_NOSYMFOLLOW)
printf(",nosymfollow");
if (flags & MOUNT_ATTR_IDMAP)
@@ -102,7 +104,7 @@ static void show_propagation(struct statmount *sm)
printf(" shared:%llu", sm->mnt_peer_group);
if (sm->mnt_propagation & MS_SLAVE) {
printf(" master:%llu", sm->mnt_master);
- if (sm->mnt_master)
+ if (sm->propagate_from && sm->propagate_from != sm->mnt_master)
printf(" propagate_from:%llu", sm->propagate_from);
}
if (sm->mnt_propagation & MS_UNBINDABLE)
---
base-commit: ee05701bd2a2e4559f35742d59922ebb9b006d3c
change-id: 20241121-statmount-924ab4233d6e
Best regards,
--
Jeff Layton <jlayton@kernel.org>
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] samples: fix missing nodiratime option and handle propagate_from correctly
2024-11-21 14:39 [PATCH] samples: fix missing nodiratime option and handle propagate_from correctly Jeff Layton
@ 2024-11-22 11:18 ` Christian Brauner
0 siblings, 0 replies; 2+ messages in thread
From: Christian Brauner @ 2024-11-22 11:18 UTC (permalink / raw)
To: Jeff Layton; +Cc: Al Viro, Jan Kara, linux-fsdevel, linux-kernel
On Thu, Nov 21, 2024 at 09:39:44AM -0500, Jeff Layton wrote:
> The nodiratime option is not currently shown. Also, the test for when
> to display propagate_from: is incorrect. Make it work like it does in
> show_mountinfo().
>
> Signed-off-by: Jeff Layton <jlayton@kernel.org>
> ---
> It might be best to just squash this patch into the one that adds the
> new sample program. Also, looks like your vfs-6.14.misc branch hasn't
> been updated yet?
I have not pushed it out but will do so now!
> ---
> samples/vfs/mountinfo.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/samples/vfs/mountinfo.c b/samples/vfs/mountinfo.c
> index d9f21113a93b7aa7606de2edfce5ad0d5bcf2056..349aaade4de53912b96eadb35bf1b7457b4b04fa 100644
> --- a/samples/vfs/mountinfo.c
> +++ b/samples/vfs/mountinfo.c
> @@ -90,6 +90,8 @@ static void show_mnt_attrs(uint64_t flags)
> break;
> }
>
> + if (flags & MOUNT_ATTR_NODIRATIME)
> + printf(",nodiratime");
> if (flags & MOUNT_ATTR_NOSYMFOLLOW)
> printf(",nosymfollow");
> if (flags & MOUNT_ATTR_IDMAP)
> @@ -102,7 +104,7 @@ static void show_propagation(struct statmount *sm)
> printf(" shared:%llu", sm->mnt_peer_group);
> if (sm->mnt_propagation & MS_SLAVE) {
> printf(" master:%llu", sm->mnt_master);
> - if (sm->mnt_master)
> + if (sm->propagate_from && sm->propagate_from != sm->mnt_master)
> printf(" propagate_from:%llu", sm->propagate_from);
> }
> if (sm->mnt_propagation & MS_UNBINDABLE)
>
> ---
> base-commit: ee05701bd2a2e4559f35742d59922ebb9b006d3c
> change-id: 20241121-statmount-924ab4233d6e
>
> Best regards,
> --
> Jeff Layton <jlayton@kernel.org>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-11-22 11:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-11-21 14:39 [PATCH] samples: fix missing nodiratime option and handle propagate_from correctly Jeff Layton
2024-11-22 11:18 ` Christian Brauner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®