Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 22 Jul 2002 22:59:53 -0700
From:      Alfred Perlstein <bright@mu.org>
To:        Bruce Evans <bde@zeta.org.au>
Cc:        fs@FreeBSD.ORG
Subject:   Re: rename hardlinks "works" on FreeBSD, but no-op on others
Message-ID:  <20020723055953.GJ77219@elvis.mu.org>
In-Reply-To: <20020723141104.G28400-100000@gamplex.bde.org>
References:  <20020723133856.L28400-100000@gamplex.bde.org> <20020723141104.G28400-100000@gamplex.bde.org>

next in thread | previous in thread | raw e-mail | index | archive | help
* Bruce Evans <bde@zeta.org.au> [020722 21:32] wrote:
> 
> POSIX.1-2001 apparently attemps to fix this.  POSIX.1-1996 says:
> 
> "If the _old_ argument and the _new_ argument both refer to links to the
> same existing file, the rename() function shall return successfully and
> perform no other action".
> 
> I don't see how "same file" in this can be read as applying to directory
> entries and not inodes.  However, the rationale strongly suggests this
> (it says that the behaviour is supposed to be compatible with undocumented
> 4.3BSD behaviour, so that rename("x", "x") doesn't remove "x").
> 
> POSIX.1-2001-draft7 says:
> 
> "If the _old_ argument and the _new_ argument resolve to [!!] the same
> existing file, the rename() function shall return successfully and
> perform no other action".
> 
> The standard still uses "refer to [...] file" in other places, so the
> changed wording is apparently meant to say that sameness is at the
> level of directory entries (much like the comment in the kernel defines
> it).  Changing "existing file" to "pathname to existing file" would
> be just wrong, since sameness is not at the level of pathnames, so it
> is probably wrong to even hint at pathname resolution here.

Er, ok.  Frankly since we're the only ones that do it "wrong" and
NFSv4 specifically states:

[http://www.ietf.org/rfc/rfc3010.txt - page 153]
      If oldname and newname both refer to the same file (they might be
      hard links of each other), then RENAME should perform no action
      and return success.

...is there some way I can convince you to polish up and commit your
deltas?

-- 
-Alfred Perlstein [alfred@freebsd.org] [#bsdcode/efnet/irc.prison.net]
'Instead of asking why a piece of software is using "1970s technology,"
 start asking why software is ignoring 30 years of accumulated wisdom.'

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-fs" in the body of the message




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