From nobody  Wed Dec  3 13:55:35 1997
Received: (from nobody@localhost)
          by hub.freebsd.org (8.8.7/8.8.7) id NAA16814;
          Wed, 3 Dec 1997 13:55:35 -0800 (PST)
          (envelope-from nobody)
Message-Id: <199712032155.NAA16814@hub.freebsd.org>
Date: Wed, 3 Dec 1997 13:55:35 -0800 (PST)
From: rjb@calyx.com
To: freebsd-gnats-submit@freebsd.org
Subject: umount fails when device is a symlink
X-Send-Pr-Version: www-1.0

>Number:         5208
>Category:       misc
>Synopsis:       umount fails when device is a symlink
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Dec  3 14:00:01 PST 1997
>Closed-Date:    Mon Jan 19 10:49:07 PST 1998
>Last-Modified:  Mon Jan 19 10:50:55 PST 1998
>Originator:     Robert Brown
>Release:        2.2.5-STABLE
>Organization:
>Environment:
FreeBSD wopr.foo.bar.com 2.2.5-STABLE FreeBSD 2.2.5-STABLE #0: Wed Nov 19 10:12:01 PST 1997     root@wopr.foo.bar.com:/usr/src/sys.stable.11.18.97/compile/vmunix  i386

>Description:
Umount will not unmount a device that was mounted via a symlink. I 
link /dev/wcd0a to /dev/cdrom so it's easier to remember. When trying
to umount it, it fails saying the device is not mounted. Check it 
out:

< Link /dev/wcd0a to /dev/cdrom>

# ln -s /dev/wcd0a /dev/cdrom
# ls -l /dev/cdrom
lrwxrwxrwx   1 root     wheel          10 Nov 18 15:50 /dev/cdrom -> /dev/wcd0a

<Mount /dev/cdrom with fstype cd9660>

# mount_cd9660 /dev/cdrom /mnt
# mount
/dev/wd0a on / (local)
procfs on /proc (local)
/dev/cdrom on /mnt (local, read-only)

<Try to unmount it>

# umount /dev/cdrom
umount: /dev/wcd0a: not currently mounted

<But it IS mounted! Ok, let's try to unmount the actual device>

# umount /dev/wcd0a
umount: /dev/wcd0a: not currently mounted

<Just to be sure we're not fooling ourselves, let's look at mount output again>

# mount
/dev/wd0a on / (local)
procfs on /proc (local)
/dev/cdrom on /mnt (local, read-only)


So, we can't unmount the filesystem because mount doesn't think it is
mounted. I think this is a bug.
>How-To-Repeat:
See above
>Fix:
Modify mount/umount to recognize and properly handle symlinks.
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: bde 
State-Changed-When: Mon Jan 19 10:49:07 PST 1998 
State-Changed-Why:  
Fixed in rev.1.12 of umount/umount.c. 
Oops, not fixed in 2.2. 
>Unformatted:
