From greg@futunusi.greens.fxis.fujixerox.co.jp  Thu Sep  4 20:00:35 2003
Return-Path: <greg@futunusi.greens.fxis.fujixerox.co.jp>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id E5C6D16A4BF
	for <FreeBSD-gnats-submit@freebsd.org>; Thu,  4 Sep 2003 20:00:34 -0700 (PDT)
Received: from mx1.fujixerox.co.jp (mx1.fujixerox.co.jp [192.26.96.11])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 95F5C43FCB
	for <FreeBSD-gnats-submit@freebsd.org>; Thu,  4 Sep 2003 20:00:33 -0700 (PDT)
	(envelope-from greg@futunusi.greens.fxis.fujixerox.co.jp)
Received: from isvw2.fujixerox.co.jp ([129.249.27.132])
	by mx1.fujixerox.co.jp (8.11.6p2/3.7W) with ESMTP
	id h8530Vu07963;
	Fri, 5 Sep 2003 12:00:31 +0900 (JST)
Received: from ns1.fujixerox.co.jp (localhost [127.0.0.1])
	by isvw2.fujixerox.co.jp (8.11.6p2/3.7W) with ESMTP id h8530UN25320;
	Fri, 5 Sep 2003 12:00:30 +0900 (JST)
Received: from futunusi.greens.fxis.fujixerox.co.jp (futunusi.greens.fxis.fujixerox.co.jp [129.249.43.10])
	by ns1.fujixerox.co.jp (8.11.6p2/3.7W) with ESMTP
	id h8530Ti11523;
	Fri, 5 Sep 2003 12:00:29 +0900 (JST)
Received: from futunusi.greens.fxis.fujixerox.co.jp (greg@localhost [127.0.0.1])
	by futunusi.greens.fxis.fujixerox.co.jp (8.12.9/8.12.8) with ESMTP id h8530MQU000556;
	Fri, 5 Sep 2003 12:00:22 +0900 (JST)
	(envelope-from greg@futunusi.greens.fxis.fujixerox.co.jp)
Received: (from greg@localhost)
	by futunusi.greens.fxis.fujixerox.co.jp (8.12.9/8.12.8/Submit) id h8530MpR000555;
	Fri, 5 Sep 2003 12:00:22 +0900 (JST)
	(envelope-from greg)
Message-Id: <200309041616.h84GGYwd000807@omoikane.greg.rim.or.jp>
Date: Fri, 5 Sep 2003 01:16:34 +0900 (JST)
From: Kensaku Masuda <greg@greg.jp>
Reply-To: Kensaku Masuda <greg@greg.jp>
To: FreeBSD-gnats-submit@freebsd.org
Cc: greg@greg.jp
Subject: mdmfs can not mount memory file system
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         56472
>Category:       bin
>Synopsis:       mdmfs can not mount memory file system
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    phk
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Sep 04 20:10:14 PDT 2003
>Closed-Date:    Fri Sep 05 02:46:03 PDT 2003
>Last-Modified:  Fri Sep 05 02:46:03 PDT 2003
>Originator:     Kensaku Masuda
>Release:        FreeBSD 5.1-CURRENT i386
>Organization:
>Environment:
System: FreeBSD omoikane.greg.rim.or.jp 5.1-CURRENT FreeBSD 5.1-CURRENT #4: Thu Sep 4 23:43:17 JST 2003 root@omoikane.greg.rim.or.jp:/a/uzume/export/src/system-current/src/sys/i386/compile/omoikane.greg.rim.or.jp i386


>Description:
	The online manua(mdmfs) say it ok to execute "mdmfs -s 32m md /tmp",
So I can create and mount memory file system, But do not

>How-To-Repeat:

do

	mdmfs -s 32m md /tmp

but,

	newfs exited with error code 1

>Fix:

- --- mdmfs.c.orig	Fri Sep  5 00:40:29 2003
+++ mdmfs.c	Fri Sep  5 00:58:42 2003
@@ -76,6 +76,7 @@
 static void	 do_mdconfig_detach(void);
 static void	 do_mount(const char *, const char *);
 static void	 do_mtptsetup(const char *, struct mtpt_info *);
+static void	 do_disklabel(void);
 static void	 do_newfs(const char *);
 static void	 extract_ugid(const char *, struct mtpt_info *);
 static int	 run(int *, const char *, ...) __printflike(2, 3);
@@ -264,6 +265,7 @@
 		do_mdconfig_attach_au(mdconfig_arg, mdtype);
 	else
 		do_mdconfig_attach(mdconfig_arg, mdtype);
+	do_disklabel();
 	do_newfs(newfs_arg);
 	do_mount(mount_arg, mtpoint);
 	do_mtptsetup(mtpoint, &mi);
@@ -424,7 +426,7 @@
 {
 	int rv;
 
- -	rv = run(NULL, "%s%s /dev/%s%d %s", _PATH_MOUNT, args,
+	rv = run(NULL, "%s%s /dev/%s%da %s", _PATH_MOUNT, args,
 	    mdname, unit, mtpoint);
 	if (rv)
 		errx(1, "mount exited with error code %d", rv);
@@ -473,10 +475,21 @@
 do_newfs(const char *args)
 {
 	int rv;
- -
- -	rv = run(NULL, "%s%s /dev/%s%d", _PATH_NEWFS, args, mdname, unit);
+	rv = run(NULL, "%s%s /dev/%s%da", _PATH_NEWFS, args, mdname, unit);
 	if (rv)
 		errx(1, "newfs exited with error code %d", rv);
+}
+
+/*
+ * Put disklabel on the memory disk
+ */
+static void
+do_disklabel(void)
+{
+	int rv;
+	rv = run(NULL, "%s -r -w %s%d auto", "/sbin/disklabel", mdname, unit);
+	if (rv)
+		errx(1, "disklabel exited with error code %d", rv);
 }
 
 /*

------- End of Forwarded Message
---
Fingerprint16 = 4F CC 44 F8 54 BE 45 3A  4F 9F 1C 4E 5E 3B 91 E9
Fingerprint20 = 12CA 6B2D DC50 8248 A636  992B 0292 F548 D65F 4D5B
-----------------+-----------------------------------$BA}ED!!7r:n(B---+
$B;0!&O;$r<i$m$&!*(B | greg@greg.jp                                   |
$B!!$*2H$X5"$m$&!*(B |   greg@fxis.fujixerox.co.jp                    |
                 |     http://www.greg.jp/~greg/                  |
-----------------+------------------------------------------------+
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->phk 
Responsible-Changed-By: nork 
Responsible-Changed-When: Thu Sep 4 22:17:17 PDT 2003 
Responsible-Changed-Why:  
Hi phk. I think this was already fixed.  Is this ok? 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
phk         2003/09/04 14:23:46 PDT 
FreeBSD src repository 
Modified files: 
sys/geom             geom_dev.c  
Log: 
Make sure to return ENOIOCTL if the ioctl is not handled. 
Revision  Changes    Path 
1.68      +2 -2      src/sys/geom/geom_dev.c 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
Please see this PR. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=56472 
State-Changed-From-To: open->closed 
State-Changed-By: phk 
State-Changed-When: Fri Sep 5 02:45:54 PDT 2003 
State-Changed-Why:  
Fixed yesterday 

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