From owner-freebsd-bugs@FreeBSD.ORG Thu Sep 4 20:10:20 2003 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 92D0D16A4BF for ; Thu, 4 Sep 2003 20:10:20 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0CCBC43FEC for ; Thu, 4 Sep 2003 20:10:15 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.9/8.12.9) with ESMTP id h853AEUp078625 for ; Thu, 4 Sep 2003 20:10:14 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.9/8.12.9/Submit) id h853AEfF078624; Thu, 4 Sep 2003 20:10:14 -0700 (PDT) Resent-Date: Thu, 4 Sep 2003 20:10:14 -0700 (PDT) Resent-Message-Id: <200309050310.h853AEfF078624@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Kensaku Masuda Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E5C6D16A4BF for ; 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 ; 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])h8530MQU000556; Fri, 5 Sep 2003 12:00:22 +0900 (JST) (envelope-from greg@futunusi.greens.fxis.fujixerox.co.jp) Received: (from greg@localhost)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 To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 cc: greg@greg.jp Subject: bin/56472: mdmfs can not mount memory file system X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Kensaku Masuda List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Sep 2003 03:10:20 -0000 >Number: 56472 >Category: bin >Synopsis: mdmfs can not mount memory file system >Confidential: no >Severity: serious >Priority: high >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Sep 04 20:10:14 PDT 2003 >Closed-Date: >Last-Modified: >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 -----------------+-----------------------------------増田 健作---+ 三・六を守ろう! | greg@greg.jp |  お家へ帰ろう! | greg@fxis.fujixerox.co.jp | | http://www.greg.jp/~greg/ | -----------------+------------------------------------------------+ >Release-Note: >Audit-Trail: >Unformatted: