kern/59739: rmdir(2) and mkdir(2) both return EISDIR for argument "/"

Andreas Fuchs asf at boinkor.net
Thu Nov 27 13:20:15 PST 2003


>Number:         59739
>Category:       kern
>Synopsis:       rmdir(2) and mkdir(2) both return EISDIR for argument "/"
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Nov 27 13:20:13 PST 2003
>Closed-Date:
>Last-Modified:
>Originator:     Andreas Fuchs
>Release:        FreeBSD 5.2-BETA i386
>Organization:
>Environment:
System: FreeBSD beaver.boinkor.net 5.2-BETA FreeBSD 5.2-BETA #6: Thu Nov 27 00:06:50 CET 2003 root@:/usr/obj/usr/src/sys/BOINKINE i386


>Description:
	Calling rmdir or mkdir on "/" returns EISDIR, but calling them 
	on any other mount point name returns the documented and correct
	return value (EBUSY for rmdir and EEXIST for mkdir).

	This seems to affect only the literal value "/". Using 
	"/etc/.." (where "etc" is a regular directory, just to be sure) 
	yields the correct result.
	
>How-To-Repeat:
	# rmdir /
	rmdir: /: Is a directory
	# rmdir /usr
	rmdir: /usr: Device busy
	# rmdir /etc/..
	rmdir: /etc/..: Device busy
	
	same for mkdir:
	# mkdir /
	mkdir: /: Is a directory
	# mkdir /usr
	mkdir: /usr: File exists
	# mkdir /etc/..
	mkdir: /etc/..: File exists
	
	(where /etc is not a mount point, so /etc/.. would be the root directory)
	I could repeat this on 5.2-BETA and 4.9-STABLE.
>Fix:

	I /think/ the problem lies somewhere in namei() (or lookup() from there)
	calls from rmdir and mkdir, but neither am I a kernel hacker nor could I 
	find the bug in there. This is all rather speculative, so I can't really 
	offer a fix - sorry.
>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list