From bthomas@virtualiron.com  Fri Sep  2 17:56:45 2005
Return-Path: <bthomas@virtualiron.com>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 07AED16A41F
	for <FreeBSD-gnats-submit@freebsd.org>; Fri,  2 Sep 2005 17:56:45 +0000 (GMT)
	(envelope-from bthomas@virtualiron.com)
Received: from mail.virtualiron.com (mail.virtualiron.com [209.213.88.114])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 83DD243D48
	for <FreeBSD-gnats-submit@freebsd.org>; Fri,  2 Sep 2005 17:56:44 +0000 (GMT)
	(envelope-from bthomas@virtualiron.com)
Received: from [10.1.2.26] ([10.1.2.26]) by mail.virtualiron.com with Microsoft SMTPSVC(6.0.3790.1830);
	 Fri, 2 Sep 2005 13:57:20 -0400
Message-Id: <4318925B.6070507@virtualiron.com>
Date: Fri, 02 Sep 2005 13:56:43 -0400
From: Ben Thomas <bthomas@virtualiron.com>
To: FreeBSD-gnats-submit@freebsd.org
Subject: [patch] allow mounting msdos files systems as root device

>Number:         85649
>Category:       kern
>Synopsis:       [msdosfs] [patch] allow mounting msdos files systems as root device
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    rodrigc
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Sep 02 18:00:34 GMT 2005
>Closed-Date:    Sun Nov 19 01:12:24 GMT 2006
>Last-Modified:  Sun Nov 19 01:12:24 GMT 2006
>Originator:     Ben Thomas
>Release:        FreeBSD 5.4-RELEASE i386
>Organization:
Virtual Iron Software
>Environment:
System: FreeBSD bthomas4.katana-technology.com 5.4-RELEASE FreeBSD 5.4-RELEASE #10: Sun Aug 28 13:48:00 EDT 2005 ben@bthomas4.katana-technology.com:/usr/obj/usr/home/ben/BSD/RELENG_5_4_0_RELEASE/src/sys/BEN i386


>Description:

Support mounting of msdosfs file systems as root.  Yes, it's unusual.  Yes,
it was needed.

This patch is against the 5_4_0_RELEASE code

>How-To-Repeat:
>Fix:

--- msdosfs_vfsops.c-DIFF begins here ---
--- /usr/src.original/sys/fs/msdosfs/msdosfs_vfsops.c	Mon Jan 31 18:25:56 2005
+++ /usr/src/sys/fs/msdosfs/msdosfs_vfsops.c	Thu Aug 11 16:16:26 2005
@@ -197,6 +197,25 @@
 	int error, flags;
 	mode_t accessmode;
 
+	/*
+	 * Use NULL path to indicate we are mounting the root filesystem.
+	 */
+	struct vnode *rootvp;
+	if (path == NULL) {
+	  if ((error = bdevvp(rootdev, &rootvp))) {
+	    printf("msdosfs_mountroot: can't find rootvp\n");
+	    return (error);
+	  }
+
+	  if ((error = mountmsdosfs(rootvp, mp, td, NULL)) != 0)
+	    return (error);
+	  (void)VFS_STATFS(mp, &mp->mnt_stat, td);
+	  (void) msdosfs_statfs(mp, &mp->mnt_stat, td);
+	  args.mask = ALLPERMS;
+	  update_mp(mp, &args, td);
+	  return (0);
+	}
+
 	error = copyin(data, (caddr_t)&args, sizeof(struct msdosfs_args));
 	if (error)
 		return (error);
--- msdosfs_vfsops.c-DIFF ends here ---
>Release-Note:
>Audit-Trail:

From: "Poul-Henning Kamp" <phk@phk.freebsd.dk>
To: Ben Thomas <bthomas@virtualiron.com>
Cc: FreeBSD-gnats-submit@FreeBSD.org
Subject: Re: kern/85649: [patch] allow mounting msdos files systems as root device 
Date: Fri, 02 Sep 2005 20:10:58 +0200

 In message <4318925B.6070507@virtualiron.com>, Ben Thomas writes:
 
 >Support mounting of msdosfs file systems as root.  Yes, it's unusual.  Yes,
 >it was needed.
 >
 >This patch is against the 5_4_0_RELEASE code
 
 This should already work in 6.x
 
 -- 
 Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
 phk@FreeBSD.ORG         | TCP/IP since RFC 956
 FreeBSD committer       | BSD since 4.3-tahoe    
 Never attribute to malice what can adequately be explained by incompetence.
State-Changed-From-To: open->feedback 
State-Changed-By: rodrigc 
State-Changed-When: Sat Jun 3 05:25:10 UTC 2006 
State-Changed-Why:  
This patch is not necessary in FreeBSD 6.x.  Have you tried 
mounting msdos filesystems as root on 6.x? 


Responsible-Changed-From-To: freebsd-bugs->rodrigc 
Responsible-Changed-By: rodrigc 
Responsible-Changed-When: Sat Jun 3 05:25:10 UTC 2006 
Responsible-Changed-Why:  
This patch is not necessary in FreeBSD 6.x.  Have you tried 
mounting msdos filesystems as root on 6.x? 

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

From: "Ben Thomas" <bthomas@virtualiron.com>
To: "Craig Rodrigues" <rodrigc@freebsd.org>, <freebsd-bugs@freebsd.org>
Cc:  
Subject: RE: kern/85649: [msdosfs] [patch] allow mounting msdos files
	systems as root device
Date: Sat, 3 Jun 2006 17:11:08 -0400

 Hi,
 
 This may work in 6.x, I haven't tried it.  At the time I submitted this, =
 and a few other bug reports/patches, I believe that 5.4 was current.  =
 About 6 months ago, I moved away from FreeBSD usage, so I haven't really =
 tried 6.x or worked with FreeBSD in that time.  I'm sorry that I'm =
 unable to be of more help.
 
 Thanks,
 -b
 
 
 
 -----Original Message-----
 From: Craig Rodrigues [mailto:rodrigc@FreeBSD.org]
 Sent: Sat 6/3/2006 1:28 AM
 To: Ben Thomas; rodrigc@FreeBSD.org; freebsd-bugs@FreeBSD.org; =
 rodrigc@FreeBSD.org
 Subject: Re: kern/85649: [msdosfs] [patch] allow mounting msdos files =
 systems as root device
 =20
 Synopsis: [msdosfs] [patch] allow mounting msdos files systems as root =
 device
 
 State-Changed-From-To: open->feedback
 State-Changed-By: rodrigc
 State-Changed-When: Sat Jun 3 05:25:10 UTC 2006
 State-Changed-Why:=20
 This patch is not necessary in FreeBSD 6.x.  Have you tried
 mounting msdos filesystems as root on 6.x?
 
 
 Responsible-Changed-From-To: freebsd-bugs->rodrigc
 Responsible-Changed-By: rodrigc
 Responsible-Changed-When: Sat Jun 3 05:25:10 UTC 2006
 Responsible-Changed-Why:=20
 This patch is not necessary in FreeBSD 6.x.  Have you tried
 mounting msdos filesystems as root on 6.x?
 
 http://www.freebsd.org/cgi/query-pr.cgi?pr=3D85649
 
 _______________________________________________
 freebsd-bugs@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-bugs
 To unsubscribe, send any mail to "freebsd-bugs-unsubscribe@freebsd.org"
State-Changed-From-To: feedback->closed 
State-Changed-By: rodrigc 
State-Changed-When: Sun Nov 19 01:11:50 UTC 2006 
State-Changed-Why:  
Feedback received, patch not necessary in RELENG_6. 

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