From owner-freebsd-bugs@FreeBSD.ORG Mon May 17 10:10:17 2004 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 6F4B116A4CF for ; Mon, 17 May 2004 10:10:17 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 895B143D5C for ; Mon, 17 May 2004 10:10:15 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) i4HHAFQo094396 for ; Mon, 17 May 2004 10:10:15 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.11/8.12.11/Submit) id i4HHAFmC094395; Mon, 17 May 2004 10:10:15 -0700 (PDT) (envelope-from gnats) Resent-Date: Mon, 17 May 2004 10:10:15 -0700 (PDT) Resent-Message-Id: <200405171710.i4HHAFmC094395@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, Alex Vasylenko Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8B8D816A4CE for ; Mon, 17 May 2004 10:06:55 -0700 (PDT) Received: from mail.omut.org (mail.omut.org [216.218.215.140]) by mx1.FreeBSD.org (Postfix) with ESMTP id 727E543D1D for ; Mon, 17 May 2004 10:06:53 -0700 (PDT) (envelope-from lxv@omut.org) Received: from tadpole.intranet (mix-anchor.intranet [10.10.10.251]) by mail.omut.org (8.12.11/8.12.11) with ESMTP id i4HH6jj5035953 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 17 May 2004 10:06:45 -0700 (PDT) (envelope-from lxv@omut.org) Received: from tadpole.intranet (localhost [127.0.0.1]) by tadpole.intranet (8.12.11/8.12.11) with ESMTP id i4HH6iLO007975 for ; Mon, 17 May 2004 13:06:44 -0400 (EDT) (envelope-from lxv@tadpole.intranet) Received: (from lxv@localhost) by tadpole.intranet (8.12.11/8.12.11/Submit) id i4HH6irJ007974; Mon, 17 May 2004 13:06:44 -0400 (EDT) (envelope-from lxv) Message-Id: <200405171706.i4HH6irJ007974@tadpole.intranet> Date: Mon, 17 May 2004 13:06:44 -0400 (EDT) From: Alex Vasylenko To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: bin/66763: mdmfs: sync arguments with those of newfs, disallow '-l' in compatibility mode X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Alex Vasylenko List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 May 2004 17:10:17 -0000 >Number: 66763 >Category: bin >Synopsis: mdmfs: sync arguments with those of newfs, disallow '-l' in compatibility mode >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon May 17 10:10:15 PDT 2004 >Closed-Date: >Last-Modified: >Originator: Alex Vasylenko >Release: FreeBSD 5.2-CURRENT i386 >Organization: >Environment: System: FreeBSD 5.2-CURRENT #6: Sat May 15 14:17:15 EDT 2004 >Description: 1. The '-n' flag to mdmfs(8) currently gets passed to newfs(8). However, this flag is no longer supported by newfs(8), so the command is going to fail. Make mdmfs(8) ignore the flag in compatibility mode; remove the support for this flag when in normal mode. 2. The new '-l' flag is permitted when mdmfs(8) is run in compatibility mode (either 'mdmfs -C' or 'mount_mfs'), but it should not be. NOTE: Do we still need the compatibility mode? (would be a nice if it's gone, as some useful options can't be used with mdmfs from fstab(5)). 3. Synchronize parameter names with those of newfs(8) for arguments passed to newfs(8): -c: cylinders -> blocks-per-cylinder-group -d: rotdelay -> max-extent-size 4. Note in the man page that '-l' is passed to newfs(8) >How-To-Repeat: mdmfs -n 32 -s 32m md /mnt mdmfs -C -l -s 32m md /mnt >Fix: Index: mdmfs.c =================================================================== RCS file: /home/ncvs/src/sbin/mdmfs/mdmfs.c,v retrieving revision 1.20 diff -u -p -r1.20 mdmfs.c --- mdmfs.c 17 May 2004 07:07:20 -0000 1.20 +++ mdmfs.c 17 May 2004 15:59:53 -0000 @@ -168,6 +168,8 @@ main(int argc, char **argv) loudsubs = true; break; case 'l': + if (compat) + usage(); argappend(&newfs_arg, "-l"); break; case 'M': @@ -185,7 +187,8 @@ main(int argc, char **argv) norun = true; break; case 'n': - argappend(&newfs_arg, "-n %s", optarg); + if (!compat) + usage(); break; case 'O': argappend(&newfs_arg, "-o %s", optarg); @@ -665,14 +668,14 @@ usage(void) name = "mdmfs"; if (!compat) fprintf(stderr, -"usage: %s [-DLlMNSUX] [-a maxcontig [-b block-size] [-c cylinders]\n" -"\t[-d rotdelay] [-e maxbpg] [-F file] [-f frag-size] [-i bytes]\n" -"\t[-m percent-free] [-n rotational-positions] [-O optimization]\n" +"usage: %s [-DLlMNSUX] [-a maxcontig [-b block-size] [-c blocks-per-cylinder-group]\n" +"\t[-d max-extent-size] [-e maxbpg] [-F file] [-f frag-size] [-i bytes]\n" +"\t[-m percent-free] [-O optimization]\n" "\t[-o mount-options] [-p permissions] [-s size] [-w user:group]\n" "\tmd-device mount-point\n", name); fprintf(stderr, -"usage: %s -C [-lNU] [-a maxcontig] [-b block-size] [-c cylinders]\n" -"\t[-d rotdelay] [-e maxbpg] [-F file] [-f frag-size] [-i bytes]\n" +"usage: %s -C [-NU] [-a maxcontig] [-b block-size] [-c blocks-per-cylinder-group]\n" +"\t[-d max-extent-size] [-e maxbpg] [-F file] [-f frag-size] [-i bytes]\n" "\t[-m percent-free] [-n rotational-positions] [-O optimization]\n" "\t[-o mount-options] [-s size] md-device mount-point\n", name); exit(1); Index: mdmfs.8 =================================================================== RCS file: /home/ncvs/src/sbin/mdmfs/mdmfs.8,v retrieving revision 1.20 diff -u -r1.20 mdmfs.8 --- mdmfs.8 17 May 2004 08:35:41 -0000 1.20 +++ mdmfs.8 17 May 2004 16:04:20 -0000 @@ -39,14 +39,13 @@ .Op Fl DLlMNSUX .Op Fl a Ar maxcontig .Op Fl b Ar block-size -.Op Fl c Ar cylinders -.Op Fl d Ar rotdelay +.Op Fl c Ar blocks-per-cylinder-group +.Op Fl d Ar max-extent-size .Op Fl e Ar maxbpg .Op Fl F Ar file .Op Fl f Ar frag-size .Op Fl i Ar bytes .Op Fl m Ar percent-free -.Op Fl n Ar rotational-positions .Op Fl O Ar optimization .Op Fl o Ar mount-options .Op Fl p Ar permissions @@ -60,8 +59,8 @@ .Op Fl lNU .Op Fl a Ar maxcontig .Op Fl b Ar block-size -.Op Fl c Ar cylinders -.Op Fl d Ar rotdelay +.Op Fl c Ar blocks-per-cylinder-group +.Op Fl d Ar max-extent-size .Op Fl e Ar maxbpg .Op Fl F Ar file .Op Fl f Ar frag-size @@ -130,25 +129,30 @@ option). .It Fl b Ar block-size The block size of the file system, in bytes. +See +.Xr newfs 8 +for details. .It Fl C Enable full compatibility mode with .Xr mount_mfs 8 . See the .Sx COMPATIBILITY section for more information. -.It Fl c Ar cylinders -The number of cylinders per cylinder group in the file system. +.It Fl c Ar blocks-per-cylinder-group +The number of blocks per cylinder group in a file system. +See +.Xr newfs 8 +for details. .It Fl D If not using auto-unit, do not run .Xr mdconfig 8 to try to detach the unit before attaching it. -.It Fl d Ar rotdelay -Specify the minimum time in milliseconds required to initiate another -disk transfer on the same cylinder. -Modern disks with read/write-behind achieve higher performance without -this feature, -so it is best to leave it at 0 milliseconds. +.It Fl d Ar max-extent-size +The file system may choose to store large files using extents. +This parameter specifies the largest extent size that may be used. +It is presently limited to its default value which is 16 times +the file system blocksize. .It Fl e Ar maxbpg Indicate the maximum number of blocks any single file can allocate out of a cylinder group before it is forced to begin allocating @@ -182,7 +186,7 @@ This is most useful in conjunction with .Fl X . .It Fl n Ar rotational-positions -The default number of rotational positions to distinguish. +This option is obsolete and is supported for compatibility only. .It Fl O Ar optimization Select the optimization preference; valid choices are @@ -277,9 +281,9 @@ .Fl s , respectively. The -.Fl a , b , c , d , e , f , i , m +.Fl a , b , c , d , e , f , i , l and -.Fl n +.Fl m options are passed to .Xr newfs 8 with the same letter; @@ -288,7 +292,13 @@ option is passed to .Xr newfs 8 as -.Fl o . +.Fl o ; +the +.Fl v +option is passed to +.Xr newfs 8 +as +.Fl O . The .Fl o option is passed to >Release-Note: >Audit-Trail: >Unformatted: