Skip to content

Commit 7636f7a

Browse files
LarsJurgensenf-firas
authored andcommitted
fix(decomposedfs): remove orphaned node file when symlink fails in TouchFile
1 parent 804f3a6 commit 7636f7a

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

  • pkg/storage/utils/decomposedfs/tree

‎pkg/storage/utils/decomposedfs/tree/tree.go‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ func (t *Tree) TouchFile(ctx context.Context, n *node.Node, markprocessing bool,
174174
childNameLink := filepath.Join(n.ParentPath(), n.Name)
175175
relativeNodePath := filepath.Join("../../../../../", lookup.Pathify(n.ID, 4, 2))
176176
if err = os.Symlink(relativeNodePath, childNameLink); err != nil {
177+
_ = os.Remove(nodePath)
177178
if errors.Is(err, fs.ErrExist) {
178179
return errtypes.AlreadyExists(n.Name)
179180
}

0 commit comments

Comments
 (0)