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
25145ebb
Commit
25145ebb
authored
Aug 12, 2011
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
UnionFs: stop leaking R/O files into directory when doing (Rename a b,
Mkdir a)
parent
90981c86
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
0 deletions
+21
-0
unionfs/unionfs.go
unionfs/unionfs.go
+9
-0
unionfs/unionfs_test.go
unionfs/unionfs_test.go
+12
-0
No files found.
unionfs/unionfs.go
View file @
25145ebb
...
...
@@ -347,6 +347,15 @@ func (me *UnionFs) Mkdir(path string, mode uint32) (code fuse.Status) {
}
me
.
branchCache
.
Set
(
path
,
branchResult
{
attr
,
fuse
.
OK
,
0
})
}
var
stream
chan
fuse
.
DirEntry
stream
,
code
=
me
.
OpenDir
(
path
)
if
code
.
Ok
()
{
for
entry
:=
range
stream
{
me
.
putDeletion
(
filepath
.
Join
(
path
,
entry
.
Name
))
}
}
return
code
}
...
...
unionfs/unionfs_test.go
View file @
25145ebb
...
...
@@ -446,6 +446,10 @@ func TestRenameDirBasic(t *testing.T) {
if
err
!=
nil
||
len
(
entries
)
!=
1
||
entries
[
0
]
.
Name
!=
"subdir"
{
t
.
Errorf
(
"readdir(%s/mount/renamed) should have one entry: %v, err %v"
,
wd
,
entries
,
err
)
}
if
err
=
os
.
Mkdir
(
wd
+
"/mount/dir"
,
0755
);
err
!=
nil
{
t
.
Errorf
(
"mkdir should succeed %v"
,
err
)
}
}
func
TestRenameDirWithDeletions
(
t
*
testing
.
T
)
{
...
...
@@ -486,6 +490,14 @@ func TestRenameDirWithDeletions(t *testing.T) {
if
fi
,
_
:=
os
.
Lstat
(
wd
+
"/mount/renamed/file.txt"
);
fi
!=
nil
{
t
.
Fatalf
(
"%s/mount/renamed/file.txt should have disappeared %#v"
,
wd
,
fi
)
}
if
err
=
os
.
Mkdir
(
wd
+
"/mount/dir"
,
0755
);
err
!=
nil
{
t
.
Errorf
(
"mkdir should succeed %v"
,
err
)
}
if
fi
,
_
:=
os
.
Lstat
(
wd
+
"/mount/dir/subdir"
);
fi
!=
nil
{
t
.
Fatalf
(
"%s/mount/dir/subdir should have disappeared %#v"
,
wd
,
fi
)
}
}
func
TestRenameSymlink
(
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