Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix ocis move #1177

Merged
merged 1 commit into from
Sep 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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