From owner-freebsd-fs Mon Jul 22 22:59:56 2002 Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C473937B400 for ; Mon, 22 Jul 2002 22:59:53 -0700 (PDT) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8818943E31 for ; Mon, 22 Jul 2002 22:59:53 -0700 (PDT) (envelope-from bright@elvis.mu.org) Received: by elvis.mu.org (Postfix, from userid 1192) id 342BDAE165; Mon, 22 Jul 2002 22:59:53 -0700 (PDT) Date: Mon, 22 Jul 2002 22:59:53 -0700 From: Alfred Perlstein To: Bruce Evans Cc: fs@FreeBSD.ORG Subject: Re: rename hardlinks "works" on FreeBSD, but no-op on others Message-ID: <20020723055953.GJ77219@elvis.mu.org> References: <20020723133856.L28400-100000@gamplex.bde.org> <20020723141104.G28400-100000@gamplex.bde.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20020723141104.G28400-100000@gamplex.bde.org> User-Agent: Mutt/1.3.27i Sender: owner-freebsd-fs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org * Bruce Evans [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