From vd@datamax.bg  Fri Mar 12 02:47:25 2004
Return-Path: <vd@datamax.bg>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 6580916A4CE
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 12 Mar 2004 02:47:25 -0800 (PST)
Received: from gw-bj2.datamax.bg (datamax.wl.bitex.com [195.34.115.67])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 6897F43D2D
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 12 Mar 2004 02:47:22 -0800 (PST)
	(envelope-from vd@datamax.bg)
Received: from sinanica.lg2a.datamax (sinanica.lg2a.datamax [192.168.10.1])
	by gw-bj2.datamax.bg (Postfix) with QMQP id 76FB587CA
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 12 Mar 2004 12:47:19 +0200 (EET)
Received: (nullmailer pid 12110 invoked by uid 1001);
	Fri, 12 Mar 2004 10:47:19 -0000
Message-Id: <1079088439.210030.12109.nullmailer@sinanica.lg2a.datamax>
Date: Fri, 12 Mar 2004 12:47:19 +0200
From: Vasil Dimov <vd@datamax.bg>
Reply-To: Vasil Dimov <vd@datamax.bg>
To: FreeBSD-gnats-submit@freebsd.org
Subject: mdmfs features via fstab
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         64153
>Category:       bin
>Synopsis:       mdmfs features via fstab
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    dd
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Mar 12 02:50:18 PST 2004
>Closed-Date:    Tue Feb 13 08:15:22 GMT 2007
>Last-Modified:  Tue Feb 13 08:15:22 GMT 2007
>Originator:     Vasil Dimov
>Release:        FreeBSD 5.2.1-RELEASE-p1 i386
>Organization:
DataMax
>Environment:
System: FreeBSD sinanica.lg2a.datamax 5.2.1-RELEASE-p1 FreeBSD 5.2.1-RELEASE-p1 #5: Thu Mar 11 13:16:46 EET 2004 root@sinanica.lg2a.datamax:/usr/src/sys/i386/compile/SINANICA-SMP i386
>Description:
We don't have mount_XXX interface to mdmfs(8), so it's
features cannot be used in fstab.
>How-To-Repeat:
We want the following line in /etc/fstab to create a malloc disk of size 32m
and mount it to /mnt:

md	/mnt	mfs	rw,-M,-s32m,-Otime,-p1777	1	0

but it calls mount_mfs which does not know about -M.
mount_FSTYPE is always searched and we can't call mdmfs.
>Fix:
some workaround can be to
ln -s /sbin/mdmfs /sbin/mount_foo
and use filesystem type foo in fstab.
But what a stupid link must be laying in /sbin/ and what a new filesystem
name to think of?

It would be better to make mount_mfs operate like mdmfs as they
are one program anyway.

mdmfs can be called with -C to operate like the old mount_mfs (compatible mode)
so I add -I (incompatible mode) to negate `-C' or `getprogname() = mount_mfs'
meaning. What we get is `mount_mfs -I' working like mdmfs. So in fstab:

md	/mnt	mfs	rw,-I,-M,-s32m,-Otime,-p1777	1	0

The following is a simple "patch":

***** BEGIN mdmfs.c.-I.patch *****
--- mdmfs.c.orig	Fri Mar 12 11:30:57 2004
+++ mdmfs.c	Fri Mar 12 11:30:47 2004
@@ -118,7 +118,7 @@
 		compat = true;
 
 	while ((ch = getopt(argc, argv,
-	    "a:b:Cc:Dd:e:F:f:hi:LMm:Nn:O:o:p:Ss:t:Uv:w:X")) != -1)
+	    "a:b:Cc:Dd:e:F:f:hIi:LMm:Nn:O:o:p:Ss:t:Uv:w:X")) != -1)
 		switch (ch) {
 		case 'a':
 			argappend(&newfs_arg, "-a %s", optarg);
@@ -157,6 +157,9 @@
 			break;
 		case 'h':
 			usage();
+			break;
+		case 'I':
+			compat = false;
 			break;
 		case 'i':
 			argappend(&newfs_arg, "-i %s", optarg);
***** END mdmfs.c.-I.patch *****

and the manual page of course:

***** BEGIN mdmfs.8.-I.patch *****
--- mdmfs.8.orig	Fri Mar 12 12:06:26 2004
+++ mdmfs.8	Fri Mar 12 12:06:16 2004
@@ -160,6 +160,13 @@
 .Ar file .
 .It Fl f Ar frag-size
 The fragment size of the file system in bytes.
+.It Fl I
+Incompatible (with mount_mfs(8)) mode. This is the default.
+It can be used to exert the
+.Nm
+power via mount_mfs command or to negate the
+.Fl C
+flag, should such a need occur.
 .It Fl i Ar bytes
 Number of bytes per inode.
 .It Fl L
***** END mdmfs.8.-I.patch *****

Cheerz!
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->dd 
Responsible-Changed-By: dd 
Responsible-Changed-When: Fri Apr 14 04:35:39 UTC 2006 
Responsible-Changed-Why:  
Remind myself to look at this (and fixing mdmfs compat in general). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=64153 
State-Changed-From-To: open->feedback 
State-Changed-By: matteo 
State-Changed-When: Sun Nov 12 10:57:34 UTC 2006 
State-Changed-Why:  
ru@ committed a fix that remove the -C option, so you can use all mdmfs options in fstab 

http://www.freebsd.org/cgi/query-pr.cgi?pr=64153 
State-Changed-From-To: feedback->closed 
State-Changed-By: matteo 
State-Changed-When: Tue Feb 13 08:14:43 UTC 2007 
State-Changed-Why:  
feedback timeout. Anyway, ru@ solved this problem back in November 2006 

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