From owner-cvs-all@FreeBSD.ORG Sat Jul 19 17:11:28 2003 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 A597D37B401; Sat, 19 Jul 2003 17:11:28 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5445A43F3F; Sat, 19 Jul 2003 17:11:28 -0700 (PDT) (envelope-from iedowse@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h6K0BS0U069885; Sat, 19 Jul 2003 17:11:28 -0700 (PDT) (envelope-from iedowse@repoman.freebsd.org) Received: (from iedowse@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h6K0BSHO069884; Sat, 19 Jul 2003 17:11:28 -0700 (PDT) Message-Id: <200307200011.h6K0BSHO069884@repoman.freebsd.org> From: Ian Dowse Date: Sat, 19 Jul 2003 17:11:28 -0700 (PDT) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/sbin/umount umount.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: Sun, 20 Jul 2003 00:11:29 -0000 iedowse 2003/07/19 17:11:27 PDT FreeBSD src repository Modified files: sbin/umount umount.c Log: Take advantage of the use of file system IDs to simplify umount(8) and make it work more reliably in a number of cases that have traditionally been troublesome. The new behaviour is: 1) If the filesystem can be determined by the fsid or device, or uniquely identified by the mountpoint, then just go ahead and call unmount(2) using the file system ID. 2) Otherwise use fstatfs(2) to resolve the path into a file system ID (checking with stat(2) that it is a filesystem root directory). Case 2 can potentially block if an NFS server is down, but it can always be avoided by using an unambiguous specification. It handles all the hard cases such as symlinks and mismatches between the mount list and reality. For example, if a filesystem was mounted as /mnt inside a chroot, it will show up in the mount list as /mnt, but now you can unmount it from outside the chroot with "umount /chroot_path/mnt". Revision Changes Path 1.39 +144 -298 src/sbin/umount/umount.c