Skip to content

Commit

Permalink
fix ocis move (#1177)
Browse files Browse the repository at this point in the history
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
  • Loading branch information
butonic authored Sep 17, 2020
1 parent 9f1e7a2 commit 345aaf8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions changelog/unreleased/fix-oci-move.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Bugfix: Fix ocis move

When renaming a file we updating the name attribute on the wrong node, causing the path construction to use the wrong name. This fixes the litmus move_coll test.

https://github.com/cs3org/reva/pull/1177
3 changes: 2 additions & 1 deletion pkg/storage/fs/ocis/tree.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,8 @@ func (t *Tree) Move(ctx context.Context, oldNode *Node, newNode *Node) (err erro
return errors.Wrap(err, "ocisfs: could not rename child")
}

tgtPath := filepath.Join(t.pw.Root, "nodes", newNode.ID)
// the new node id might be different, so we need to use the old nodes id
tgtPath := filepath.Join(t.pw.Root, "nodes", oldNode.ID)

// update name attribute
if err := xattr.Set(tgtPath, "user.ocis.name", []byte(newNode.Name)); err != nil {
Expand Down

0 comments on commit 345aaf8

Please sign in to comment.