aboutsummaryrefslogtreecommitdiff
path: root/internal/fusefrontend
diff options
context:
space:
mode:
authorJakob Unterwurzacher2017-01-26 20:56:42 +0100
committerJakob Unterwurzacher2017-01-26 20:56:42 +0100
commita7c7588deb2f256775667c986e1d85965dc2c3e6 (patch)
tree5d023f3030415baad74a50b9a7ad32c2db837a0d /internal/fusefrontend
parentd2224aec5833ac7fabd73c56e43f3a4c820ac1ec (diff)
fusefrontend: fix hard-linking with long name
This used to incorrectly try to link twice and return EEXIST.
Diffstat (limited to 'internal/fusefrontend')
-rw-r--r--internal/fusefrontend/fs.go4
1 files changed, 1 insertions, 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))
}