From a7c7588deb2f256775667c986e1d85965dc2c3e6 Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Thu, 26 Jan 2017 20:56:42 +0100 Subject: [PATCH] fusefrontend: fix hard-linking with long name This used to incorrectly try to link twice and return EEXIST. --- internal/fusefrontend/fs.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/internal/fusefrontend/fs.go b/internal/fusefrontend/fs.go index 6165d86..cdbb7e5 100644 --- a/internal/fusefrontend/fs.go +++ b/internal/fusefrontend/fs.go @@ -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)) }