NetBSD Problem Report #59495

From greywolf@valentina.serenity.starwolf.com  Sun Jun 29 22:02:49 2025
Return-Path: <greywolf@valentina.serenity.starwolf.com>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits)
	 client-signature RSA-PSS (2048 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 692C91A923A
	for <gnats-bugs@gnats.NetBSD.org>; Sun, 29 Jun 2025 22:02:49 +0000 (UTC)
Message-Id: <20250629220247.E594D15840@valentina.serenity.starwolf.com>
Date: Sun, 29 Jun 2025 15:02:47 -0700 (PDT)
From: greywolf@valentina.serenity.starwolf.com
Reply-To: greywolf@valentina.serenity.starwolf.com
To: gnats-bugs@NetBSD.org
Subject: umount -v is too verbose; should need -vv (as mount)
X-Send-Pr-Version: 3.95

>Number:         59495
>Category:       bin
>Synopsis:       umount -v shows all-or-nothing on unmounting filesystems
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sun Jun 29 22:05:00 +0000 2025
>Last-Modified:  Tue Jul 01 20:15:01 +0000 2025
>Originator:     greywolf@valentina.serenity.starwolf.com
>Release:        NetBSD 10.1 [built 2025-03-05T11:23: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:
	[See my disclaimer for the PR sent before this for "mount -v"].

	umount -v seems excessively verbose; in contrast with just showing
	what it is unmounting, it is also showing "Trying unmount program..." and
	"(no separate unmount program)"; some application of additional
	instances of -v would be useful here.

	Again, if this is deemed "an egregious hack", I would like to know
	the rationale behind all-or-nothing output from umount -v.

	Patches attached

>How-To-Repeat:
	umount -v {filesystem}

	: note the additional output besides simply
	: "{dev}: umount from {dir}"
>Fix:
--- umount.c.orig	2025-06-29 14:04:24.334557542 -0700
+++ umount.c	2025-06-29 14:11:05.687333437 -0700
@@ -130,7 +130,7 @@
 			typelist = makevfslist(optarg);
 			break;
 		case 'v':
-			verbose = 1;
+			verbose++;
 			break;
 #endif /* !SMALL */
 		default:
@@ -275,7 +275,7 @@
 	if (verbose) {
 		(void)printf("%s: unmount from %s\n", name, mntpt);
 		/* put this before the test of FAKE */ 
-		if (!raw) {
+		if (!raw && verbose > 1) {
 			(void)printf("Trying unmount program %s\n",
 			    umountprog);
 		}
@@ -308,7 +308,7 @@
 	}

 #ifndef SMALL
-	if (verbose)
+	if (verbose > 1)
 		(void)printf("(No separate unmount program.)\n");
 #endif


--- umount.8.orig	2025-06-29 15:01:30.930607016 -0700
+++ umount.8	2025-06-29 14:17:56.481070826 -0700
@@ -154,8 +154,9 @@
 and
 .Tn MFS .
 .It Fl v
-Verbose, additional information is printed out as each file system
-is unmounted.
+Verbose mode.  List each filesystem as it is unmounted.
+If this flag is specified more than once, additional information is printed out as each
+file system is unmounted.
 .El
 .Sh FILES
 .Bl -tag -width /etc/fstab -compact

>Audit-Trail:
From: "Robert Elz" <kre@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/59495 CVS commit: src/sbin/umount
Date: Tue, 1 Jul 2025 20:11:14 +0000

 Module Name:	src
 Committed By:	kre
 Date:		Tue Jul  1 20:11:14 UTC 2025

 Modified Files:
 	src/sbin/umount: umount.8 umount.c

 Log Message:
 PR bin/59495

 Make umount less noisy when a single -v is used (just say
 what has been unmounted), and only include details of
 running (or not running) external umount_fstype progs
 when more than one -v is given.

 While here, make it more clear in the messages produce
 when the -F (fake it) option is used, that nothing was
 actually unmounted (just what would have been).

 Man page updated to match.


 To generate a diff of this commit:
 cvs rdiff -u -r1.22 -r1.23 src/sbin/umount/umount.8
 cvs rdiff -u -r1.55 -r1.56 src/sbin/umount/umount.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2025 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.