Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 28 Feb 2010 19:49:37 +0200
From:      Jaakko Heinonen <jh@FreeBSD.org>
To:        Bruce Evans <brde@optusnet.com.au>
Cc:        freebsd-hackers@FreeBSD.org, Poul-Henning Kamp <phk@phk.freebsd.dk>
Subject:   namei() returns EISDIR for "/" (Re: svn commit: r203990 - head/lib/libc/sys)
Message-ID:  <20100228174936.GA1252@a91-153-117-195.elisa-laajakaista.fi>
In-Reply-To: <20100226091923.X2605@delplex.bde.org>
References:  <6413.1266433105@critter.freebsd.dk> <20100218064545.J2074@besplex.bde.org> <20100218095538.GA2318@a91-153-117-195.elisa-laajakaista.fi> <20100225195138.GA3323@a91-153-117-195.elisa-laajakaista.fi> <20100226091923.X2605@delplex.bde.org>

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

[Moving discussion to -hackers. This is not directly related to the
original commit anymore.]

On 2010-02-26, Bruce Evans wrote:
> > 	http://people.freebsd.org/~jh/patches/lookup-root.diff

> This is in relookup().  I think relookup() is only called from rename(),
> so the failing case is unreachable

I don't think it's true for unionfs. Looking at the code it seems that
it can call relookup() also with CREATE and DELETE nameiops.

> % @@ -3618,9 +3618,6 @@ kern_renameat(struct thread *td, int old
> %  	if (fromnd.ni_vp->v_type == VDIR)
> %  		tond.ni_cnd.cn_flags |= WILLBEDIR;
> %  	if ((error = namei(&tond)) != 0) {
> % -		/* Translate error code for rename("dir1", "dir2/."). */
> % -		if (error == EISDIR && fvp->v_type == VDIR)
> % -			error = EINVAL;
> 
> I think this has nothing to do with the root directory (as its comment says),
> but it is to translate the EISDIR returned by ufs_lookup(), etc., when `tond'
> is for a (directory) pathname ending in ".".  So it should not be removed,
> except possibly after changing ufs_lookup(), etc., to return EINVAL.  The
> EISDIR in ufs_lookup() is only for RENAME, so it is strange that any
> translation is needed.  I apparently put the translation here to avoid
> looking at all leaf file systems.

After r199137 the case of "dir2/." is handled in lookup() before the
VOP_LOOKUP() call. I am not sure if it should be removed but it seems
that there's no need for the translation after r199137.

-- 
Jaakko



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