Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go-fuse
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Levin Zimmermann
go-fuse
Commits
91451a73
Commit
91451a73
authored
Jan 06, 2022
by
hotaery
Committed by
Han-Wen Nienhuys
Jan 11, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fs: update oldParent.children for exchange rename
Change-Id: I7b8d1a6be288324021c846273aceb08eb9010e98
parent
701e7fc8
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
1 deletion
+17
-1
fs/inode.go
fs/inode.go
+1
-1
fs/loopback_linux_test.go
fs/loopback_linux_test.go
+16
-0
No files found.
fs/inode.go
View file @
91451a73
...
...
@@ -703,7 +703,7 @@ retry:
}
if
destChild
!=
nil
{
oldParent
.
children
[
oldName
]
=
old
Child
oldParent
.
children
[
oldName
]
=
dest
Child
oldParent
.
changeCounter
++
destChild
.
parents
.
add
(
parentData
{
oldName
,
oldParent
})
...
...
fs/loopback_linux_test.go
View file @
91451a73
...
...
@@ -75,6 +75,22 @@ func TestRenameExchange(t *testing.T) {
if
!
reflect
.
DeepEqual
(
after2
,
before1
)
{
t
.
Errorf
(
"after2, before1: %#v, %#v"
,
after2
,
before1
)
}
root
:=
tc
.
loopback
.
EmbeddedInode
()
.
Root
()
ino1
:=
root
.
GetChild
(
"file"
)
if
ino1
==
nil
{
t
.
Fatalf
(
"root.GetChild(%q): null inode"
,
"file"
)
}
ino2
:=
root
.
GetChild
(
"dir"
)
.
GetChild
(
"file"
)
if
ino2
==
nil
{
t
.
Fatalf
(
"dir.GetChild(%q): null inode"
,
"file"
)
}
if
ino1
.
StableAttr
()
.
Ino
!=
after1
.
Ino
{
t
.
Errorf
(
"got inode %d for %q, want %d"
,
ino1
.
StableAttr
()
.
Ino
,
"file"
,
after1
.
Ino
)
}
if
ino2
.
StableAttr
()
.
Ino
!=
after2
.
Ino
{
t
.
Errorf
(
"got inode %d for %q want %d"
,
ino2
.
StableAttr
()
.
Ino
,
"dir/file"
,
after2
.
Ino
)
}
}
func
TestRenameNoOverwrite
(
t
*
testing
.
T
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment