rename of hardlinked files

Peter Waechtler peter at helios.de
Fri May 28 07:07:51 GMT 2004


Am Freitag, 28. Mai 2004 06:15 schrieb Jeremy Allison:
> On Thu, May 27, 2004 at 10:44:11PM -0500, Steven French wrote:
> > One of the connectathon POSIX file subtests does a rename of fileA to
> > fileB where fileA and fileB are hardlinked.   For POSIX this is supposed
> > to be a noop, but Samba (and Windows) return STATUS_NAME_COLLISION which
> > causes the Linux cifs client (which does not realize that they are
> > hardlinked) to delete the target and retry the rename.   Since the rename
> > smb op (and the SMB NT Rename as well) only have a 16 bit attributes
> > field passed on the request, it does not look like the trick of passing
> > ATTR_POSIX_SEMANTICS would work (since it is an attribute flag in the
> > range above 64K which can only be passed in 32 bit attribute fields such
> > as what NTCreate allows).
> >
> > Ideas?
>
> Hmmm. A new UNIX_RENAME call ?

Don't delete the target name - just fail if it's not a directory.
Then it's the "app" that can decide: Overwrite? Yes -> the target gets deleted
(the name is unlinked, the source name still has link count of 1) and the
source is renamed.

How does the test look like?




More information about the samba-technical mailing list