Subject: bin/3016: can't umount(8) a NFS mounted file. (swap file)
To: None <gnats-bugs@gnats.netbsd.org>
From: Andrew Gillham <gillhaa@ghost.whirlpool.com>
List: netbsd-bugs
Date: 12/10/1996 01:06:18
>Number:         3016
>Category:       bin
>Synopsis:       can't umount(8) a NFS mounted file. (swap file)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Dec  9 22:20:02 1996
>Last-Modified:
>Originator:     Andrew Gillham
>Organization:
-----------------------------------------------------------------
Andrew Gillham                            | This space left blank
gillham@whirlpool.com                     | inadvertently.
I speak for myself, not for my employer.  | Contact the publisher.
>Release:        -current
>Environment:
	-current as of 12/10/96.  Presumably in all versions though.
	I noticed this on my Alpha.  (166Mhz UDB/Multia)


>Description:
	It is possibly to NFS mount individual files, particularly
	swap files for diskless workstations.  Once it is mounted, it
	is not possible to umount(8) the file.  The error message from
	umount is:
	"umount: /mnt: not a directory or special device"
	this is because umount checks for S_ISDIR, and S_ISBLK, so the
	file isn't a valid mountpoint.
>How-To-Repeat:
	Export something with '-alldirs', and then mount a file from that
	export.  My example is the swap file for my DEC Multia:
	# mount server:/usr/export/swap/multia /mnt
	# mount
	/dev/sd0a on / type ffs (local)
	/dev/sd0e on /usr type ffs (local)
	server:/usr/export/swap/multia on /mnt type nfs
	# umount /mnt
	umount: /mnt: not a directory or special device
	#
>Fix:
	I'm not sure what the "clean" fix would be.  Potentially the
	force option should skip the S_ISBLK/S_ISDIR check and attempt
	the umount. 
>Audit-Trail:
>Unformatted: