From owner-freebsd-hackers Tue Aug 8 02:48:26 1995 Return-Path: hackers-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.11/8.6.6) id CAA14011 for hackers-outgoing; Tue, 8 Aug 1995 02:48:26 -0700 Received: from physics.su.oz.au (physics.su.OZ.AU [129.78.129.1]) by freefall.cdrom.com (8.6.11/8.6.6) with SMTP id CAA13985 for ; Tue, 8 Aug 1995 02:48:20 -0700 Received: by physics.su.oz.au id AA18633 (5.67b/IDA-1.4.4 for freebsd-hackers@freebsd.org); Tue, 8 Aug 1995 19:47:21 +1000 From: David Dawes Message-Id: <199508080947.AA18633@physics.su.oz.au> Subject: Re: patch adding the 'noauto' switch to 'mount' To: simon@masi.ibp.fr Date: Tue, 8 Aug 1995 19:47:20 +1000 (EST) Cc: freebsd-hackers@freebsd.org In-Reply-To: <199508080842.KAA00358@neuromancer.ibp.fr> from "simon@masi.ibp.fr" at Aug 8, 95 10:42:21 am X-Mailer: ELM [version 2.4 PL23] Content-Type: text Content-Length: 2477 Sender: hackers-owner@freebsd.org Precedence: bulk >> > +#define MNT_NOAUTO 0x00000003 /* don't mount with 'mount -a' */ >> >> WRONG VALUE!!! These are bit fields, not integers. MNT_NOAUTO is now >> the same as -o ro,sync :-(. MNT_NOAUTO does _not_ belong on in this >> set of bit patterns, the kernel could care less about this! We are also >> out of bits for some structures that try to store this value :-(. > >Argh :-O > >You're right on both points. The kernel doesn't even see that flag, since >it's processed prior to the actual mounting of the FS, and it would >be a Bad Thing to waste a precious bit-mask value on it (the first >available one is 0x04000000). > >We need to have MNT_NOAUTO defined, though. >how about : > >#define MNT_NOAUTO 0x00000000 > >This shouldn't interfere with the existing flags (right ?) and it wouldn't >really waste a value. > >What do you think ? Any other ideas ? The following patch seems to do the right thing for me (I've only tested it with cd9660 so far though, and I haven't really looked into it far enough to know if it causes other problems). David -------- Index: usr/src/sbin/mount/mntopts.h *** 1.1.1.2 1995/06/12 15:05:20 --- mntopts.h 1995/08/08 09:42:47 *************** *** 61,66 **** --- 61,68 ---- #define MOPT_RO { "ro", 0, MNT_RDONLY, 0 } #define MOPT_RW { "rw", 1, MNT_RDONLY, 0 } + #define MOPT_NOAUTO { "auto", 1, 0, 0 } + #define MOPT_FSTAB_COMPAT \ MOPT_RO, \ MOPT_RW *************** *** 68,73 **** --- 70,76 ---- /* Standard options which all mounts can understand. */ #define MOPT_STDOPTS \ MOPT_FSTAB_COMPAT, \ + MOPT_NOAUTO, \ MOPT_NODEV, \ MOPT_NOEXEC, \ MOPT_NOSUID, \ Index: usr/src/sbin/mount/mount.c *** 1.1.1.2 1995/03/27 05:22:08 --- mount.c 1995/08/08 00:50:54 *************** *** 166,175 **** continue; if (badvfsname(fs->fs_vfstype, vfslist)) continue; if (mountfs(fs->fs_vfstype, fs->fs_spec, ! fs->fs_file, init_flags, options, ! fs->fs_mntops)) ! rval = 1; } else { if ((mntsize = getmntinfo(&mntbuf, MNT_NOWAIT)) == 0) --- 166,177 ---- continue; if (badvfsname(fs->fs_vfstype, vfslist)) continue; + if (!strstr(fs->fs_mntops, "noauto")) { if (mountfs(fs->fs_vfstype, fs->fs_spec, ! fs->fs_file, init_flags, options, ! fs->fs_mntops)) ! rval = 1; ! } } else { if ((mntsize = getmntinfo(&mntbuf, MNT_NOWAIT)) == 0)