fusefrontend: fix hard-linking with long name

This used to incorrectly try to link twice and return EEXIST.
This commit is contained in:
Jakob Unterwurzacher 2017-01-26 20:56:42 +01:00
parent d2224aec58
commit a7c7588deb
1 changed files with 1 additions and 3 deletions

View File

@ -480,7 +480,6 @@ func (fs *FS) Link(oldPath string, newPath string, context *fuse.Context) (code
if err != nil {
return fuse.ToStatus(err)
}
// Handle long file name
cNewName := filepath.Base(cNewPath)
if nametransform.IsLongContent(cNewName) {
@ -498,10 +497,9 @@ func (fs *FS) Link(oldPath string, newPath string, context *fuse.Context) (code
err = syscall.Link(cOldPath, cNewPath)
if err != nil {
nametransform.DeleteLongName(dirfd, cNewName)
return fuse.ToStatus(err)
}
return fuse.ToStatus(err)
}
return fuse.ToStatus(os.Link(cOldPath, cNewPath))
}