Subject: Re: umount won't
To: Jukka Marin , Port-i386 <port-i386@NetBSD.ORG>
From: Chuck Silvers <chuq@chuq.com>
List: port-i386
Date: 09/10/2001 00:59:17
hi,

I just had a similar thing happen, but mine was due to an i/o error
from a flaky cd.  when I ktruss'd umount, it showed that __getcwd()
was returning ENOENT and then umount would print an error message
and exit without actually attempting to unmount the filesystem.
this is from this block of code in umount.c:

		if (realpath(name, rname) == NULL) {
			warn("%s", rname);
			return (1);
		}


for just cases like this, I think it would be better to do

		if (realpath(name, rname) == NULL) {
			warn("%s", rname);
			strlcpy(rname, name, sizeof(rname));
		}


I'll commit this in a few days if no one has a better idea.

-Chuck


On Fri, Aug 24, 2001 at 07:42:21AM +0300, Jukka Marin wrote:
> root@pyy / # umount /cd0
> umount: /cd0: No such file or directory
> root@pyy / # umount -f /cd0
> umount: /cd0: No such file or directory
> root@pyy / # df cd0
> Filesystem  1024-blocks     Used    Avail Capacity  Mounted on
> /dev/cd0d        391896   391896        0   100%    /cd0
> root@pyy / # ls -l |grep cd0
> dr-xr-xr-x   1 root  wheel  688717824 Jan  1  1970 cd0
> root@pyy / # mount /dev/cd0d /a
> mount_ffs: /dev/cd0d on /a: Device busy
> 
> All I did was that I accidentally removed the CD before umount and then the
> daily script tried to run find or something on /cd0.
> 
> Looks like removable media support could use some improvement.. :-/
> 
>   -jm