cvs commit: src/sbin/mount Makefile mount.c src/sys/ufs/ffs
ffs_vfsops.c
Bruce Evans
bde at zeta.org.au
Tue Apr 27 03:09:37 PDT 2004
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
More information about the cvs-src
mailing list