From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andries Brouwer Subject: Re: handling unrecognised mount options Date: Mon, 17 Mar 2003 10:18:47 +0100 Sender: linux-fsdevel-owner@vger.kernel.org Message-ID: <20030317091847.GA7977@win.tue.nl> References: <20030316203420.797ad47f.akpm@digeo.com> <20030316213227.1ce61c77.akpm@digeo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Szakacsits Szabolcs , linux-fsdevel@vger.kernel.org, ext2-devel@lists.sourceforge.net Return-path: To: Andrew Morton Content-Disposition: inline In-Reply-To: <20030316213227.1ce61c77.akpm@digeo.com> List-Id: linux-fsdevel.vger.kernel.org On Sun, Mar 16, 2003 at 09:32:27PM -0800, Andrew Morton wrote: > Szakacsits Szabolcs wrote: > > > 2) [re]mount with the feature if supported by the kernel > > Yeah, well. That's what I'm doing at present in rc.local. It's > pretty lame. (i) testing kernel version is often required: Of course one hopes that initscripts can be independent of the kernel version. But usually they cannot. Today 2.4.20 and 2.5.64 number my ethernet cards differently, so the network scripts have to depend on kernel version. The use of ipfwadm / ipchains / iptables depends on kernel version. In the course of time I have seen lp0 and lp1 being interchanged, the numbering of partitions changed (with BSD slices after all DOS-type partitions) etc. (ii) mounting a filesystem may be dangerous for the kernel: Many filesystem implementations do not check everything read from disk but just use this data. If the disk filesystem is corrupt, or if the filesystem was mounted with the wrong type this can cause kernel corruption. (iii) mounting a filesystem may be dangerous for the filesystem: Clearly, if the kernel writes to the filesystem and is mistaken about its type, the filesystem can be corrupted. (iv) mount options given help determining filesystem type and semantics In "mount -t ufs -o ufstype=sunx86" the filesystem type is determined by an option. Certainly one should not ignore this option on old kernels where it is not implemented. In "mount -t vfat -o gid=15" mount permissions are defined. Certainly one should not ignore this option on old kernels where it is not implemented. In "mount -t ext2 -o grpid" semantics for the group ID of newly created files is defined. Etc. (v) users are lazy Of course everybody should always define the filesystem type when giving a mount command. But people prefer to type as little as possible, and let mount do the probing. This means that "mount dev /dir -o errors=remount-ro" only considers filesystem types where "errors=remount-ro" is a known option. And "mount dev /dir -o gid=15" will only consider filesystem types where "gid=15" is a known option. Ignoring unknown options makes this dangerous probing a little bit more dangerous. In your particular situation ignoring this unknown option may be harmless. But in general it is not. Andries