fusefrontend: fix hard-linking with long name
This used to incorrectly try to link twice and return EEXIST.
This commit is contained in:
parent
d2224aec58
commit
a7c7588deb
|
@ -480,7 +480,6 @@ func (fs *FS) Link(oldPath string, newPath string, context *fuse.Context) (code
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fuse.ToStatus(err)
|
return fuse.ToStatus(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Handle long file name
|
// Handle long file name
|
||||||
cNewName := filepath.Base(cNewPath)
|
cNewName := filepath.Base(cNewPath)
|
||||||
if nametransform.IsLongContent(cNewName) {
|
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)
|
err = syscall.Link(cOldPath, cNewPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
nametransform.DeleteLongName(dirfd, cNewName)
|
nametransform.DeleteLongName(dirfd, cNewName)
|
||||||
return fuse.ToStatus(err)
|
|
||||||
}
|
}
|
||||||
|
return fuse.ToStatus(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
return fuse.ToStatus(os.Link(cOldPath, cNewPath))
|
return fuse.ToStatus(os.Link(cOldPath, cNewPath))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue