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
844c2d15
Commit
844c2d15
authored
Apr 29, 2011
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
UnionFs: fix thinko with removeDeletion.
parent
77de056f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
6 deletions
+14
-6
unionfs/unionfs.go
unionfs/unionfs.go
+4
-5
unionfs/unionfs_test.go
unionfs/unionfs_test.go
+10
-1
No files found.
unionfs/unionfs.go
View file @
844c2d15
...
@@ -181,15 +181,15 @@ func (me *UnionFs) deletionPath(name string) string {
...
@@ -181,15 +181,15 @@ func (me *UnionFs) deletionPath(name string) string {
}
}
func
(
me
*
UnionFs
)
removeDeletion
(
name
string
)
{
func
(
me
*
UnionFs
)
removeDeletion
(
name
string
)
{
fileName
:=
me
.
deletionPath
(
name
)
marker
:=
me
.
deletionPath
(
name
)
me
.
deletionCache
.
RemoveEntry
(
path
.
Base
(
fileName
))
me
.
deletionCache
.
RemoveEntry
(
path
.
Base
(
marker
))
// os.Remove tries to be smart and issues a Remove() and
// os.Remove tries to be smart and issues a Remove() and
// Rmdir() sequentially. We want to skip the 2nd system call,
// Rmdir() sequentially. We want to skip the 2nd system call,
// so use syscall.Unlink() directly.
// so use syscall.Unlink() directly.
errno
:=
syscall
.
Unlink
(
name
)
errno
:=
syscall
.
Unlink
(
marker
)
if
errno
!=
0
&&
errno
!=
syscall
.
ENOENT
{
if
errno
!=
0
&&
errno
!=
syscall
.
ENOENT
{
log
.
Printf
(
"error unlinking %s: %v"
,
fileName
,
errno
)
log
.
Printf
(
"error unlinking %s: %v"
,
marker
,
errno
)
}
}
}
}
...
@@ -570,7 +570,6 @@ func (me *UnionFs) Open(name string, flags uint32) (fuseFile fuse.File, status f
...
@@ -570,7 +570,6 @@ func (me *UnionFs) Open(name string, flags uint32) (fuseFile fuse.File, status f
}
}
branch
=
0
branch
=
0
}
}
return
me
.
fileSystems
[
branch
]
.
Open
(
name
,
uint32
(
flags
))
return
me
.
fileSystems
[
branch
]
.
Open
(
name
,
uint32
(
flags
))
}
}
...
...
unionfs/unionfs_test.go
View file @
844c2d15
...
@@ -247,8 +247,17 @@ func TestCreate(t *testing.T) {
...
@@ -247,8 +247,17 @@ func TestCreate(t *testing.T) {
CheckSuccess
(
err
)
CheckSuccess
(
err
)
}
}
func
TestOpenUndeletes
(
t
*
testing
.
T
)
{
wd
,
state
:=
setup
(
t
)
defer
state
.
Unmount
()
writeToFile
(
wd
+
"/ro/file"
,
"X"
,
true
)
err
:=
os
.
Remove
(
wd
+
"/mount/file"
)
CheckSuccess
(
err
)
writeToFile
(
wd
+
"/mount/file"
,
"X"
,
true
)
_
,
err
=
os
.
Lstat
(
wd
+
"/mount/file"
)
CheckSuccess
(
err
)
}
func
TestMkdir
(
t
*
testing
.
T
)
{
func
TestMkdir
(
t
*
testing
.
T
)
{
wd
,
state
:=
setup
(
t
)
wd
,
state
:=
setup
(
t
)
defer
state
.
Unmount
()
defer
state
.
Unmount
()
...
...
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