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
4e9a1e68
Commit
4e9a1e68
authored
May 14, 2011
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use tombstones correctly for directories that exist in r/o branches.
parent
9c05c7ba
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
11 deletions
+32
-11
unionfs/unionfs.go
unionfs/unionfs.go
+12
-11
unionfs/unionfs_test.go
unionfs/unionfs_test.go
+20
-0
No files found.
unionfs/unionfs.go
View file @
4e9a1e68
...
@@ -264,19 +264,20 @@ func (me *UnionFs) Rmdir(path string) (code fuse.Status) {
...
@@ -264,19 +264,20 @@ func (me *UnionFs) Rmdir(path string) (code fuse.Status) {
if
!
r
.
attr
.
IsDirectory
()
{
if
!
r
.
attr
.
IsDirectory
()
{
return
syscall
.
ENOTDIR
return
syscall
.
ENOTDIR
}
}
if
r
.
branch
>
0
{
stream
,
code
:=
me
.
fileSystems
[
r
.
branch
]
.
OpenDir
(
path
)
stream
,
code
:=
me
.
OpenDir
(
path
)
if
code
.
Ok
()
{
found
:=
false
_
,
ok
:=
<-
stream
for
_
=
range
stream
{
if
ok
{
found
=
true
// TODO - should consume stream.
}
return
syscall
.
ENOTEMPTY
if
found
{
}
return
syscall
.
ENOTEMPTY
}
me
.
putDeletion
(
path
)
return
fuse
.
OK
}
}
if
r
.
branch
>
0
{
code
=
me
.
putDeletion
(
path
)
return
code
}
code
=
me
.
fileSystems
[
0
]
.
Rmdir
(
path
)
code
=
me
.
fileSystems
[
0
]
.
Rmdir
(
path
)
if
code
!=
fuse
.
OK
{
if
code
!=
fuse
.
OK
{
return
code
return
code
...
...
unionfs/unionfs_test.go
View file @
4e9a1e68
...
@@ -449,3 +449,23 @@ func TestTruncateTimestamp(t *testing.T) {
...
@@ -449,3 +449,23 @@ func TestTruncateTimestamp(t *testing.T) {
t
.
Error
(
"timestamp drift"
,
truncTs
,
fi
.
Mtime_ns
)
t
.
Error
(
"timestamp drift"
,
truncTs
,
fi
.
Mtime_ns
)
}
}
}
}
func
TestRemoveAll
(
t
*
testing
.
T
)
{
t
.
Log
(
"TestRemoveAll"
)
wd
,
clean
:=
setupUfs
(
t
)
defer
clean
()
err
:=
os
.
Mkdir
(
wd
+
"/ro/dir"
,
0755
)
CheckSuccess
(
err
)
contents
:=
"hello"
fn
:=
wd
+
"/ro/dir/y"
err
=
ioutil
.
WriteFile
(
fn
,
[]
byte
(
contents
),
0644
)
CheckSuccess
(
err
)
err
=
os
.
RemoveAll
(
wd
+
"/mount/dir"
)
if
err
!=
nil
{
t
.
Error
(
"Should delete all"
)
}
}
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