From owner-cvs-all@FreeBSD.ORG Tue Apr 27 03:09:37 2004 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A378816A4CE; Tue, 27 Apr 2004 03:09:37 -0700 (PDT) Received: from mailout2.pacific.net.au (mailout2.pacific.net.au [61.8.0.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id DEDF243D68; Tue, 27 Apr 2004 03:09:34 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: from mailproxy1.pacific.net.au (mailproxy1.pacific.net.au [61.8.0.86])i3RA9X5v030545; Tue, 27 Apr 2004 20:09:33 +1000 Received: from gamplex.bde.org (katana.zip.com.au [61.8.7.246]) i3RA9UI2018180; Tue, 27 Apr 2004 20:09:32 +1000 Date: Tue, 27 Apr 2004 20:09:28 +1000 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: Bosko Milekic In-Reply-To: <20040427115536.W7721@gamplex.bde.org> Message-ID: <20040427195514.T9334@gamplex.bde.org> References: <200404261513.i3QFDkb5026044@repoman.freebsd.org> <20040427115536.W7721@gamplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: cvs-src@freebsd.org cc: src-committers@freebsd.org cc: cvs-all@freebsd.org Subject: Re: cvs commit: src/sbin/mount Makefile mount.c src/sys/ufs/ffs ffs_vfsops.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Apr 2004 10:09:37 -0000 On Tue, 27 Apr 2004, Bruce Evans wrote: > On Mon, 26 Apr 2004, Bosko Milekic wrote: > > > bmilekic 2004/04/26 08:13:46 PDT > > > > FreeBSD src repository > > > > Modified files: > > sbin/mount Makefile mount.c > > sys/ufs/ffs ffs_vfsops.c > > Log: > > The previous change to mount(8) to report ufs or ufs2 used > > libufs, which only works for Charlie root. > > > > This change reverts the introduction of libufs and moves the > > check into the kernel. Since the f_fstypename is the same > > for both ufs and ufs2, we check fs_magic for presence of > > ufs2 and copy "ufs2" explicitly instead. > > This seems to fix things like "mount -t ufs" and "find / -fstype ufs" > to not work with ufs2. Many scripts may depend on this. Testing shows that "df -t ufs" only finds ufs (because it looks up file systems by type name), but "find / -fstype ufs" cannot distinguish ufs from ufs2 (because it looks up file systems by type number). I think "mount -a -t ufs" works like "df -t ufs". The number in find's lookup is the type number returned by statfs(). Lookup by number is a historical bug. It is fixed in NetBSD: %%% --- function.c Sun Apr 4 14:44:05 2004 +++ /c/NetBSD/src/usr.bin/find/function.c Mon Apr 26 21:36:04 2004 @@ -819,66 +762,52 @@ * always copy both of them. */ - val_flags = sb.f_flags; - val_type = sb.f_type; + val = sb.f_flag; + strlcpy(fstype, sb.f_fstypename, sizeof(fstype)); } - switch (plan->flags & F_MTMASK) { + switch (plan->flags) { case F_MTFLAG: - return val_flags & plan->mt_data; + return (val & plan->mt_data); case F_MTTYPE: - return val_type == plan->mt_data; + return (strncmp(fstype, plan->c_data, MFSNAMELEN) == 0); default: abort(); } } ... %%% Bruce