From owner-freebsd-hackers@FreeBSD.ORG Mon Apr 18 13:37:49 2005 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0518016A4CF for ; Mon, 18 Apr 2005 13:37:49 +0000 (GMT) Received: from marlena.vvi.at (marlena.vvi.at [208.252.225.59]) by mx1.FreeBSD.org (Postfix) with ESMTP id D43E343D2D for ; Mon, 18 Apr 2005 13:37:47 +0000 (GMT) (envelope-from www@marlena.vvi.at) Received: from marlena.vvi.at (localhost.marlena.vvi.at [127.0.0.1]) by marlena.vvi.at (8.12.10/8.12.9) with ESMTP id j3IDcSh3029684; Mon, 18 Apr 2005 06:38:30 -0700 (PDT) (envelope-from www@marlena.vvi.at) Received: (from www@localhost) by marlena.vvi.at (8.12.10/8.12.10/Submit) id j3IDcMWf029681; Mon, 18 Apr 2005 06:38:22 -0700 (PDT) (envelope-from www) Date: Mon, 18 Apr 2005 06:38:22 -0700 (PDT) Message-Id: <200504181338.j3IDcMWf029681@marlena.vvi.at> To: andrit@ukr.net From: "ALeine" cc: c0ldbyte@myrealbox.com cc: mrparsons@gmail.com cc: freebsd-hackers@freebsd.org Subject: Re: ext2 drives under 5.3 not umounting on reboots X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Apr 2005 13:37:49 -0000 andrit@ukr.net wrote: > I've had the same problem on 5.3. > now on my FreeBSD 5.4-RC2 #0: Fri Apr 15 11:28:48 EEST 2005 i386 > it seems that problem gone. > > On Sunday 17 April 2005 00:07, c0ldbyte wrote: > > On Sat, 16 Apr 2005, M. Parsons wrote: > > > > > I have a ext2 linux partition mounted under /linux via the > > > fstab line: > > > > > > /dev/ad2s1 /linux ext2fs rw 1 2 > > > > > > It will automount on bootup, but if I do a reboot or shutdown > > > -h now, it doesnt get umounted properly. In fact, if this /linux > > > is mounted, then /, /usr, /var, and /tmp (all seperate ufs slices > > > on another hard drive) also get tainted during a reboot. A couple of weeks ago I saw what I believe to be the same problem, but on 4.10-STABLE. My attempt to umount an ext2 volume resulted in failure with the "unknown mount type" error message. I then resorted to using umount -t ext2fs /linux and the volume was unmounted properly, so as a workaround you could specify umount -t ext2fs explicitly in rc.shutdown or similar. I checked the sources in an attempt to find the cause and here is what I found out: In src/sbin/umount.c: RELENG_5: In umountall(): /* Ignore unknown file system types. */ if (getvfsbyname(fs->fs_vfstype, &vfc) == -1) continue; if (checkvfsname(fs->fs_vfstype, typelist)) continue; ... rval = umountall(typelist); rval = checkname(cp, typelist) || rval; free(cp); return (rval); } while ((fs = getfsent()) != NULL); return (0); } In checkname(): if (sfs == NULL) { warnx("%s: unknown file system", name); return (1); } if (checkvfsname(sfs->f_fstypename, typelist)) return (1); return (umountfs(sfs)); } RELENG4: In umountall(): /* If an unknown file system type, complain. */ if (getvfsbyname(fs->fs_vfstype, &vfc) == -1) { warnx("%s: unknown mount type", fs->fs_vfstype); continue; } if (checkvfsname(fs->fs_vfstype, typelist)) continue; ... rval = umountall(typelist); rval = umountfs(cp, typelist) || rval; free(cp); return (rval); } while ((fs = getfsent()) != NULL); return (0); } As you can see, the RELENG_5 code was changed to call a separate function named checkname() instead of checking and reporting name problems directly, but in that process a new check is introduced in a way that makes it possible for umount(8) to fail without reporting the reason for failure. Neither getvfsbyname(3) in src/lib/libc/gen/getvfsbyname.c nor checkvfsname() in src/sbin/mount/vfslist.c have changed in significant ways that would indicate they could be at fault, however there might be a problem with keeping track of filesystem modules, specifically, fs_vfstype (struct fstab) on RELENG_{4,5} and/or f_fstypename (struct statfs) on RELENG_5. Any clues? ALeine ___________________________________________________________________ WebMail FREE http://mail.austrosearch.net