From archie@packetdesign.com  Thu Apr 26 17:51:51 2001
Return-Path: <archie@packetdesign.com>
Received: from mailman.packetdesign.com (dns.packetdesign.com [65.192.41.10])
	by hub.freebsd.org (Postfix) with ESMTP id D8D2E37B423
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 26 Apr 2001 17:51:50 -0700 (PDT)
	(envelope-from archie@packetdesign.com)
Received: from bubba.packetdesign.com (bubba.packetdesign.com [192.168.0.223])
	by mailman.packetdesign.com (8.11.0/8.11.0) with ESMTP id f3R0pj262021
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 26 Apr 2001 17:51:45 -0700 (PDT)
	(envelope-from archie@packetdesign.com)
Received: (from archie@localhost)
	by bubba.packetdesign.com (8.11.3/8.11.1) id f3R0pj155977;
	Thu, 26 Apr 2001 17:51:45 -0700 (PDT)
	(envelope-from archie)
Message-Id: <200104270051.f3R0pj155977@bubba.packetdesign.com>
Date: Thu, 26 Apr 2001 17:51:45 -0700 (PDT)
From: Archie Cobbs <archie@packetdesign.com>
Reply-To: archie@packetdesign.com
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: mount -w doesn't work on a normally read-only filesystem
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         26886
>Category:       bin
>Synopsis:       mount -w doesn't work on a normally read-only filesystem
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    dd
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Apr 26 18:00:03 PDT 2001
>Closed-Date:    Thu Jun 7 18:03:49 PDT 2001
>Last-Modified:  Thu Jun 07 18:04:00 PDT 2001
>Originator:     Archie Cobbs
>Release:        FreeBSD 4.3-RELEASE i386
>Organization:
Packet Design
>Environment:
System: FreeBSD bubba.packetdesign.com 4.3-RELEASE FreeBSD 4.3-RELEASE #0: Thu Apr 26 15:28:39 PDT 2001 root@bubba.packetdesign.com:/usr/obj/usr/src/sys/BUBBA i386


>Description:

	The "-w" flag to mount(8) doesn't work if the filesystem
	is marked with the "ro" option in /etc/fstab.

	It seems like "-w" should override /etc/fstab.

>How-To-Repeat:

	Have an /etc/fstab entry like this:

	  # Device      Mountpoint   FStype  Options         Dump    Pass#
	  /dev/ad0s1e   /foo       ufs     ro              1       1

	With the filesystem unmounted, do this:

	  $ mount -w /foo

	The filesystem is mounted read-only instead of read-write.

>Fix:

	$ mount /foo
	$ mount -u /foo

>Release-Note:
>Audit-Trail:

From: Dima Dorfman <dima@unixfreak.org>
To: archie@packetdesign.com
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: bin/26886: mount -w doesn't work on a normally read-only filesystem 
Date: Thu, 26 Apr 2001 18:35:57 -0700

 Archie Cobbs <archie@packetdesign.com> writes:
 > 
 > >Number:         26886
 > >Category:       bin
 > >Synopsis:       mount -w doesn't work on a normally read-only filesystem
 > >Description:
 > 
 > 	The "-w" flag to mount(8) doesn't work if the filesystem
 > 	is marked with the "ro" option in /etc/fstab.
 > 
 > 	It seems like "-w" should override /etc/fstab.
 
 Could you please try the attached patch?  (There may be a little fuzz;
 I've some local modifications that I had to coerce out of the diff
 manually.)
 
 Thanks,
 
 					Dima Dorfman
 					dima@unixfreak.org
 
 
 Index: mount.c
 ===================================================================
 RCS file: /st/src/FreeBSD/src/sbin/mount/mount.c,v
 retrieving revision 1.41
 diff -u -r1.41 mount.c
 --- mount.c	2000/11/22 17:54:56	1.41
 +++ mount.c	2001/04/27 01:34:17
 @@ -410,6 +412,9 @@
  		optbuf = catopt(optbuf, "force");
  	if (flags & MNT_RDONLY)
  		optbuf = catopt(optbuf, "ro");
 +	else
 +		remopt(optbuf, "ro");
 +
  	/*
  	 * XXX
  	 * The mount_mfs (newfs) command uses -o to select the
State-Changed-From-To: open->analyzed 
State-Changed-By: dd 
State-Changed-When: Tue May 1 19:21:30 PDT 2001 
State-Changed-Why:  
Problem fixed in -current.  -stable is also affected; I'll MFC this later. 


Responsible-Changed-From-To: freebsd-bugs->dd 
Responsible-Changed-By: dd 
Responsible-Changed-When: Tue May 1 19:21:30 PDT 2001 
Responsible-Changed-Why:  
My MFC reminder. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=26886 
State-Changed-From-To: analyzed->closed 
State-Changed-By: dd 
State-Changed-When: Thu Jun 7 18:03:49 PDT 2001 
State-Changed-Why:  
MFC'd 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=26886 
>Unformatted:
