From nobody@FreeBSD.org  Tue Dec 28 22:52:12 2004
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 7454A16A4CE
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 28 Dec 2004 22:52:12 +0000 (GMT)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 613D343D1D
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 28 Dec 2004 22:52:12 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id iBSMqAAA028218
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 28 Dec 2004 22:52:10 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id iBSMqAG6028217;
	Tue, 28 Dec 2004 22:52:10 GMT
	(envelope-from nobody)
Message-Id: <200412282252.iBSMqAG6028217@www.freebsd.org>
Date: Tue, 28 Dec 2004 22:52:10 GMT
From: Dirk-Willem van Gulik <dirkx@webweaving.org>
To: freebsd-gnats-submit@FreeBSD.org
Subject: mount -p on unionfs results in non parsable fstab file
X-Send-Pr-Version: www-2.3

>Number:         75585
>Category:       bin
>Synopsis:       [unionfs] mount -p on unionfs results in non parsable fstab file
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    matteo
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Dec 28 23:00:49 GMT 2004
>Closed-Date:    Mon Mar 31 11:02:12 UTC 2008
>Last-Modified:  Mon Mar 31 11:02:12 UTC 2008
>Originator:     Dirk-Willem van Gulik
>Release:        5.3
>Organization:
Stiching Wirelessleiden
>Environment:
FreeBSD kobus.cnodelcpl.wleiden.net 5.3-STABLE FreeBSD 5.3-STABLE #1: Sat Dec 18 00:32:30 CET 2004     root@kobus.cnodelcpl.wleiden.net:/usr/obj/usr/src/sys/GENERIC  i386
>Description:
A mount -p should print out the mounted information in a file format usable in /etc/fstab.

When a unionfs is mounted this is not the case; each union mount is prefixed with an <above>:.

>How-To-Repeat:
      Mount union fs, then do mount -p >> /etc/fstab followed by a mount -a to see the errors

>Fix:
      change something inside mount to print it in a complaint format.
>Release-Note:
>Audit-Trail:

From: Matteo Riondato <rionda@gufi.org>
To: bug-followup@FreeBSD.org, dirkx@webweaving.org
Cc:  
Subject: Re:bin/75585: [unionfs] mount -p on unionfs results in non parsable fstab file
Date: Sat, 11 Jun 2005 17:21:09 +0200

 Patch for this (can be found at http://www.riondabsd.net/diff/mount.diff ):
 --- mount.c.old	Sat Jun 11 14:22:44 2005
 +++ mount.c	Sat Jun 11 14:31:17 2005
 @@ -80,7 +80,7 @@
  			int, const char *, const char *);
  void	remopt(char *, const char *);
  void	prmount(struct statfs *);
 -void	putfsent(const struct statfs *);
 +void	putfsent(struct statfs *);
  void	usage(void);
  char   *flags2opts(int);
  
 @@ -714,12 +714,17 @@
  
  void
  putfsent(ent)
 -	const struct statfs *ent;
 +	struct statfs *ent;
  {
  	struct fstab *fst;
  	char *opts;
  
  	opts = flags2opts(ent->f_flags);
 +	if (strncmp(ent->f_mntfromname, "<below>", 7) == 0 ||
 +		strncmp(ent->f_mntfromname, "<above>", 7) == 0) {
 +		strcpy(ent->f_mntfromname,
 +			(strnstr(ent->f_mntfromname, ":", 8) +1));
 +	}	
  	printf("%s\t%s\t%s %s", ent->f_mntfromname, ent->f_mntonname,
  	    ent->f_fstypename, opts);
  	free(opts);
 
 
 Best Regards
 -- 
 Rionda aka Matteo Riondato
 G.U.F.I. Staff Member (http://www.gufi.org)
 FreeSBIE Developer (http://www.freesbie.org)
Responsible-Changed-From-To: freebsd-bugs->matteo 
Responsible-Changed-By: matteo 
Responsible-Changed-When: Sat Mar 4 11:02:11 UTC 2006 
Responsible-Changed-Why:  
I'll handle this 

http://www.freebsd.org/cgi/query-pr.cgi?pr=75585 
State-Changed-From-To: open->patched 
State-Changed-By: matteo 
State-Changed-When: Dom 3 Feb 2008 17:24:15 UTC 
State-Changed-Why:  
I committed a fix for this on HEAD. MFC coming in a week 

http://www.freebsd.org/cgi/query-pr.cgi?pr=75585 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/75585: commit references a PR
Date: Sun,  3 Feb 2008 17:24:07 +0000 (UTC)

 matteo      2008-02-03 17:23:58 UTC
 
   FreeBSD src repository
 
   Modified files:
     sbin/mount           mount.c 
   Log:
   Fix printing of unionfs mounts when using the -p option
   
   PR:              bin/75585
   MFC after:      1 week
   
   Revision  Changes    Path
   1.97      +8 -2      src/sbin/mount/mount.c
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/75585: commit references a PR
Date: Sun, 30 Mar 2008 19:42:39 +0000 (UTC)

 matteo      2008-03-30 19:42:34 UTC
 
   FreeBSD src repository
 
   Modified files:        (Branch: RELENG_7)
     sbin/mount           mount.c 
   Log:
   MFC rev. 1.97-1.98
   
   Fix printing of unionfs mounts when using the -p option
   Fix mount -p and mount -u -ocurrent on gjournaled FS
   
   PR: bin/75585, bin/120162
   
   Revision  Changes    Path
   1.96.2.1  +8 -3      src/sbin/mount/mount.c
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: patched->closed 
State-Changed-By: matteo 
State-Changed-When: Lun 31 Mar 2008 11:01:56 UTC 
State-Changed-Why:  
MFC'ed to RELENG_7 

http://www.freebsd.org/cgi/query-pr.cgi?pr=75585 
>Unformatted:
