mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton@kernel.org>
To: Christian Brauner <brauner@kernel.org>,
	 Al Viro <viro@zeniv.linux.org.uk>, Jan Kara <jack@suse.cz>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	 Jeff Layton <jlayton@kernel.org>
Subject: [PATCH] samples: fix missing nodiratime option and handle propagate_from correctly
Date: Thu, 21 Nov 2024 09:39:44 -0500	[thread overview]
Message-ID: <20241121-statmount-v1-1-09c85a7d5d50@kernel.org> (raw)

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>


             reply	other threads:[~2024-11-21 14:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-21 14:39 Jeff Layton [this message]
2024-11-22 11:18 ` Christian Brauner

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=20241121-statmount-v1-1-09c85a7d5d50@kernel.org \
    --to=jlayton@kernel.org \
    --cc=brauner@kernel.org \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /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

all inboxes | Powered by JetHome®