Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 3 Oct 1999 00:10:34 +0200
From:      Martin Blapp <mb@imp.ch>
To:        freebsd-hackers@freebsd.org
Cc:        cvs-committers@freebsd.org
Subject:   umount(8) or unmount(2) ?
Message-ID:  <Pine.SGI.4.10.9910022341350.20259-100000@mephisto.imp.ch>

next in thread | raw e-mail | index | archive | help

Hi,

Since about 5 weeks I'm working on sanity checks and bug fixes
for umount(8), mount(8) and mount_xxx(8). Poul Henning told
me to mail to cvs-committers too, cause many clued people read it.

You'll find my patch and the readme for it on :

http://www.attic.ch/patches/MOUNTPATCH-CURRENT-02101999-01
http://www.attic.ch/patches/MOUNTPATCH-README

My problem is, that all fixes do their work. But it is not clear,
if some work should be in kernel- or user-land. Some people just like to
have umount(8) as a wrapper to unmount(2) and don't like umount(8)
to do sanity checks. This is the case for this part of umount(8) I've
replaced:

-       origname = name;
-       if (stat(name, &sb) < 0) {
-               mntpt = rname;
-               if ((getmntname(rname, MNTFROM, &type) == NULL) &&
-                   ((mntpt = getmntname(name, MNTON, &type)) == NULL)) {
-                       warnx("%s: not currently mounted", name);
-                       return (1);
-               }

I've replaced stat() and realpath() on the mountpoint with () realpath on
the basedir of the mointpoint and added some sanity checks. Most of my
mount-order checks I added in umount(8) relay on a resolved mountpoint.

I've implemented this as an idea from phk and it works very well. If we
unmount a hanged nfs-mount - it hangs no in kernel (if busy), not in
userland. This is a little step forward. Some side-effects of this
part of my patch are, that some other PR's are fixed too :

o [1999/02/03] bin/9893             NFS umount of regular file impossible
s [1995/11/27] bin/841              stale nfs mounts cannot be umounted

If we find the mntonname or mntfromname in the mounttable, we just
go ahead and unmount it. No stat() or anything else is needed.

Please tell me what you're thinking about these ideas and the work I've 
done and show me why I am wrong. Thank you very much !

Martin



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.SGI.4.10.9910022341350.20259-100000>