Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 May 1997 23:39:05 +0900 (JST)
From:      Takahiro Yugawa <yugawa@orleans.rim.or.jp>
To:        FreeBSD-gnats-submit@FreeBSD.ORG
Cc:        yugawa@oleo.orleans.rim.or.jp
Subject:   bin/3588: Memory Filesystem unmounting problem
Message-ID:  <199705131439.XAA04885@oleo.orleans.rim.or.jp>
Resent-Message-ID: <199705131510.IAA24168@hub.freebsd.org>

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

>Number:         3588
>Category:       bin
>Synopsis:       Memory Filesystem unmounting problem
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue May 13 08:10:01 PDT 1997
>Last-Modified:
>Originator:     Takahiro Yugawa
>Organization:
personal FreeBSD user in Japan
>Release:        FreeBSD 2.2.1-RELEASE i386
>Environment:
	General FreeBSD environment with 'options MFS' enabled kernel.

>Description:
	When unmounting mfs like '# umount /tmp', 
	umount process searches for host 'mfs'.
	And if there is a host named 'mfs', an error will occur with
	umount command.
	If there isn't a host named 'mfs' but the host is configured to
	use name server, umount produces unnecessary network packet.

	In /usr/src/sbin/umount/umount.c, there is a function named 
	umountfs(). The argument to the function umountfs(), named 'name',
	is a file system name (which can see at the left most column 
	at the output of df command).
	Umountfs() searches '@' or ':' character in variable 'name' to see
	if it is a NFS or not. Since file system name for mfs is
	'mfs:[pid of mfs]', umountfs() thinks it is a NFS (because there is
	':' in it) and then searches for host named 'mfs' with
	gethostbyname() function.

>How-To-Repeat:
	First, prepare a kernel with 'options MFS' enabled.
	Then prepare a host named 'mfs'. The easiest way is to add 
	an alias 'mfs' to localhost(127.0.0.1) in /etc/hosts like, 

	127.0.0.1	localhost mfs

	Then mount mfs with mount_mfs command like,

	# mount_mfs -s 2048 /dev/wd0s2b /tmp

	And, then umount mfs with umount command like,

	# umount /tmp

	This umount process produces message like
        "Cannot MNT PRC: RPC: Program not registered."
	
	Or, give an IP address for host 'mfs'(actually it isn't exist),
	and do mounting & umounting as above produces message like
	"Cannot MNT PRC: RPC: Port mapper failure - RPC: Unable to send."

	In any cases, mfs will actually umounted, though.
>Fix:
	I think there are several ways to fix the problem.
	One of them is to change file system name for mfs to something
	like 'mfs![pid of mfs]', and not include a character '@' or ':'
	in it.
	I didn't do this because I wonder there may be some side effects.
	Another way and my solution is to change
	/usr/src/sbin/umount/umount.c like this.

*** umount.c.orig	Tue May 13 23:31:17 1997
--- umount.c	Tue May 13 23:31:40 1997
***************
*** 219,225 ****
  	if (!selected(type))
  		return (0);
  
! 	if ((delimp = strchr(name, '@')) != NULL) {
  		hostp = delimp + 1;
  		*delimp = '\0';
  		hp = gethostbyname(hostp);
--- 219,227 ----
  	if (!selected(type))
  		return (0);
  
! 	if (strstr( name, "mfs:" ) == name && isdigit(*(name+4))) {
! 		hp = NULL;
! 	} else if ((delimp = strchr(name, '@')) != NULL) {
  		hostp = delimp + 1;
  		*delimp = '\0';
  		hp = gethostbyname(hostp);

>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199705131439.XAA04885>