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
Kirill Smelkov
go-fuse
Commits
74a78660
Commit
74a78660
authored
Apr 04, 2019
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nodefs: don't tweak MemRegularFile mode
parent
58aa3140
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
1 deletion
+12
-1
nodefs/mem.go
nodefs/mem.go
+0
-1
nodefs/mem_test.go
nodefs/mem_test.go
+12
-0
No files found.
nodefs/mem.go
View file @
74a78660
...
...
@@ -34,7 +34,6 @@ func (f *MemRegularFile) Open(ctx context.Context, flags uint32) (fh FileHandle,
func
(
f
*
MemRegularFile
)
Getattr
(
ctx
context
.
Context
,
fh
FileHandle
,
out
*
fuse
.
AttrOut
)
syscall
.
Errno
{
out
.
Attr
=
f
.
Attr
out
.
Mode
^=
0222
out
.
Attr
.
Size
=
uint64
(
len
(
f
.
Data
))
return
OK
}
...
...
nodefs/mem_test.go
View file @
74a78660
...
...
@@ -46,6 +46,9 @@ func TestDataFile(t *testing.T) {
ctx
,
&
MemRegularFile
{
Data
:
[]
byte
(
want
),
Attr
:
fuse
.
Attr
{
Mode
:
0464
,
},
},
NodeAttr
{})
n
.
AddChild
(
"file"
,
ch
,
false
)
...
...
@@ -53,6 +56,15 @@ func TestDataFile(t *testing.T) {
})
defer
clean
()
var
st
syscall
.
Stat_t
if
err
:=
syscall
.
Lstat
(
mntDir
+
"/file"
,
&
st
);
err
!=
nil
{
t
.
Fatalf
(
"Lstat: %v"
,
err
)
}
if
want
:=
uint32
(
syscall
.
S_IFREG
|
0464
);
st
.
Mode
!=
want
{
t
.
Errorf
(
"got mode %o, want %o"
,
st
.
Mode
,
want
)
}
fd
,
err
:=
syscall
.
Open
(
mntDir
+
"/file"
,
syscall
.
O_RDONLY
,
0
)
if
err
!=
nil
{
t
.
Fatalf
(
"Open: %v"
,
err
)
...
...
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