NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
bin/59494: mount -v too chatty/messy
>Number: 59494
>Category: bin
>Synopsis: mount -v gives more information than is desired
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: bin-bug-people
>State: open
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Sun Jun 29 21:55:00 +0000 2025
>Originator: greywolf%valentina.serenity.starwolf.com@localhost
>Release: NetBSD 10.1 [build from 2025-05-03T11:27:00-0700]
>Organization:
--*greywolf;
>Environment:
System: NetBSD valentina.serenity.starwolf.com 10.1 NetBSD 10.1 (VALENTINA) #3: Sun Jun 29 12:09:29 PDT 2025 root@:/usr/src/sys/arch/amd64/compile/VALENTINA amd64
Architecture: x86_64
Machine: amd64
>Description:
I'm chagrined to even be saying this, so I'll just preface all
this with "In my opinion..."
mount -v prints out unnecessary information when mounting
filesystems; without the -v, it is silent, but with the -v it
prints the exec string and the filesystem read/write stats in
addition to the "{dev} on {dir} type {fstype}". ->I think<- the
exec string and the other stats should depend upon more -v flags,
and a single -v flag should just list the output.
If this is egregious, you have my apologies, but I would certainly
like to know why the decision was made such that output is pretty
much all-or-nothing.
Patch added; I did my best not to make it "an egregious hack".
>How-To-Repeat:
mount -v {pick a filesystem of your choice}
It shows the exec, the actual mount, and fsid/read/write stats.
>Fix:
--- mount.c.orig 2025-06-29 13:24:50.474675703 -0700
+++ mount.c 2025-06-29 13:54:58.344278494 -0700
@@ -200,6 +200,7 @@
rval = 1;
}
} else {
+ verbose += verbose? 1: 0;
if ((mntsize = getmntinfo(&mntbuf, MNT_NOWAIT)) == 0)
err(EXIT_FAILURE, "getmntinfo");
for (i = 0; i < mntsize; i++) {
@@ -464,7 +465,7 @@
argv[argc++] = name;
argv[argc] = NULL;
- if ((verbose && buf == NULL) || debug) {
+ if ((verbose > 1 && buf == NULL) || debug) {
(void)printf("exec:");
for (i = 0; i < argc; i++)
(void)printf(" %s", argv[i]);
@@ -581,6 +582,11 @@
sfp->f_mntonname, (int)sizeof(sfp->f_fstypename),
sfp->f_fstypename);
+ if (verbose <= 1) {
+ (void)printf("\n");
+ return;
+ }
+
flags = sfp->f_flag & MNT_VISFLAGMASK;
for (f = 0, o = optnames; flags && o <
&optnames[sizeof(optnames)/sizeof(optnames[0])]; o++)
@@ -600,18 +606,18 @@
else
(void)printf("%d", sfp->f_owner);
}
- if (verbose)
+ if (verbose > 1)
(void)printf("%sfsid: 0x%x/0x%x",
!f++ ? " (" /* ) */: ", ",
sfp->f_fsidx.__fsid_val[0], sfp->f_fsidx.__fsid_val[1]);
- if (verbose) {
+ if (verbose > 1) {
(void)printf("%s", !f++ ? " (" : ", ");
(void)printf("reads: sync %" PRIu64 " async %" PRIu64 "",
sfp->f_syncreads, sfp->f_asyncreads);
(void)printf(", writes: sync %" PRIu64 " async %" PRIu64 "",
sfp->f_syncwrites, sfp->f_asyncwrites);
- if (verbose > 1) {
+ if (verbose > 2) {
char buf[2048];
if (getmntargs(sfp, buf, sizeof(buf)))
>Unformatted:
Home |
Main Index |
Thread Index |
Old Index