Date: Tue, 10 Sep 2002 23:22:03 +1000 (EST) From: Bruce Evans <bde@zeta.org.au> To: Eivind Eklund <eivind@FreeBSD.org> Cc: Bruce Evans <bde@FreeBSD.org>, <cvs-committers@FreeBSD.org>, <cvs-all@FreeBSD.org> Subject: Re: cvs commit: src/sys/kern vfs_syscalls.c src/sys/gnu/ext2fs ext2_vnops.c src/sys/ufs/ufs ufs_vnops.c Message-ID: <20020910230114.K1753-100000@gamplex.bde.org> In-Reply-To: <20020910124618.GC86704@phoenix.dmnstech.net>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 10 Sep 2002, Eivind Eklund wrote:
> On Tue, Sep 10, 2002 at 04:09:13AM -0700, Bruce Evans wrote:
> > bde 2002/09/10 04:09:13 PDT
> >
> > Modified files:
> > sys/kern vfs_syscalls.c
> > sys/gnu/ext2fs ext2_vnops.c
> > sys/ufs/ufs ufs_vnops.c
> > Log:
> > vfs_syscalls.c:
> > Changed rename(2) to follow the letter of the POSIX spec. POSIX
> > requires rename() to have no effect if its args "resolve to the same
> > existing file". I think "file" can only reasonably be read as referring
> > to the inode, although the rationale and "resolve" seem to say that
> > sameness is at the level of (resolved) directory entries.
>
> This seems to be wrong semantics to me - as far as I can tell, you've just
> made the mv in the following case pass through without any change:
> touch a
> ln a b
> mv a b
> ... which would normally result in you just having the link 'b' to the file
> originally named 'a', but you are silently leaving 'a' and 'b'.
Yes, POSIX seems to require leaving 'a' alone here. I used essentially this
to test recent changes.
> The POSIX interpretation would seem to prohibit the mv in
> mkdir d
> touch d/a
> ln -s d d2
> mv d2/a d/a
> from having any effect, which makes way more sense to me. This also seems to
> be what the old code did.
Er, this case shouldn't work. I think it didn't. d2/a and d/a are the same
directory entry here. Perhaps you meant:
mkdir d d2
touch d/a
ln d/a d2/a2
mv d2/a2 d/a
POSIX seems to require leaving d2/a2 alone here.
Bruce
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020910230114.K1753-100000>
