From mellon@techunix.technion.ac.il  Mon Mar 23 13:25:30 1998
Received: from techunix.technion.ac.il (mellon@techunix.technion.ac.il [132.68.1.28])
          by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id NAA12141
          for <FreeBSD-gnats-submit@freebsd.org>; Mon, 23 Mar 1998 13:24:53 -0800 (PST)
          (envelope-from mellon@techunix.technion.ac.il)
Received: (from mellon@localhost)
	by techunix.technion.ac.il (8.8.7/8.8.5) id AAA08158;
	Tue, 24 Mar 1998 00:24:08 +0300 (IDT)
Message-Id: <19980324002407.01739@techunix.technion.ac.il>
Date: Tue, 24 Mar 1998 00:24:07 +0300
From: Anatoly Vorobey <mellon@pobox.com>
To: FreeBSD-gnats-submit@freebsd.org
Subject: Write statistics for ro mounts are silly
X-Send-Pr-Version: 3.2

>Number:         6114
>Category:       bin
>Synopsis:       Write statistics for ro mounts are silly
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Mar 23 13:30:16 PST 1998
>Closed-Date:    Tue Mar 31 02:12:19 PST 1998
>Last-Modified:  Tue Mar 31 02:13:30 PST 1998
>Originator:     Anatoly Vorobey
>Release:        FreeBSD 3.0-CURRENT i386
>Organization:
>Environment:

	

>Description:

In mount.c, printing "writes: %d async: %d" is silly and 
meaningless for ro mounts. IMHO, better to either change it to
"writes: none" (patch below), or to eliminate "writes: " at all.

>How-To-Repeat:

>Fix:

Index: ./sbin/mount/mount.c
===================================================================
RCS file: /src/CVS/src/sbin/mount/mount.c,v
retrieving revision 1.23
diff -u -r1.23 mount.c
--- mount.c	1998/03/08 09:56:02	1.23
+++ mount.c	1998/03/24 00:08:35
@@ -480,10 +480,12 @@
 	struct opt *o;
 	struct passwd *pw;
 	int f;
+        int rdonly;
 
 	(void)printf("%s on %s", sfp->f_mntfromname, sfp->f_mntonname);
 
 	flags = sfp->f_flags & MNT_VISFLAGMASK;
+        rdonly = flags & MNT_RDONLY;
 	for (f = 0, o = optnames; flags && o->o_opt; o++)
 		if (flags & o->o_opt) {
 			(void)printf("%s%s", !f++ ? " (" : ", ", o->o_name);
@@ -496,8 +498,12 @@
 		else
 			(void)printf("%d", sfp->f_owner);
 	}
-	(void)printf("%swrites: sync %d async %d)\n", !f++ ? " (" : ", ",
-	    sfp->f_syncwrites, sfp->f_asyncwrites);
+        if(!rdonly)
+		(void)printf("%swrites: sync %d async %d)\n", 
+                             !f++ ? " (" : ", ",
+	    	              sfp->f_syncwrites, sfp->f_asyncwrites);
+        else
+		(void)printf("%swrites: none)\n", !f++ ? " (" : ", ");
 }
 
 struct statfs *



-- 
Anatoly Vorobey,
mellon@pobox.com http://pobox.com/~mellon/
"Angels can fly because they take themselves lightly" - G.K.Chesterton
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: peter 
State-Changed-When: Tue Mar 31 02:12:19 PST 1998 
State-Changed-Why:  
Fixed (differently) in src/sbin/mount.c rev 1.24.  Thanks for the report 
though! 
>Unformatted:
