Commit 3e9dd8f9 authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys Committed by Han-Wen Nienhuys

Set Nlink == 1 for GetAttr calls too.

Change-Id: I78393b40721d71a6ba4cdc634da079dec5669c26
parent 8ad69801
...@@ -139,6 +139,12 @@ func (c *rawBridge) GetAttr(input *fuse.GetAttrIn, out *fuse.AttrOut) (code fuse ...@@ -139,6 +139,12 @@ func (c *rawBridge) GetAttr(input *fuse.GetAttrIn, out *fuse.AttrOut) (code fuse
return code return code
} }
if out.Nlink == 0 {
// With Nlink == 0, newer kernels will refuse link
// operations.
out.Nlink = 1
}
node.mount.fillAttr(out, input.NodeId) node.mount.fillAttr(out, input.NodeId)
return fuse.OK return fuse.OK
} }
......
...@@ -27,7 +27,7 @@ func setupZipfs(t *testing.T) (mountPoint string, cleanup func()) { ...@@ -27,7 +27,7 @@ func setupZipfs(t *testing.T) (mountPoint string, cleanup func()) {
} }
mountPoint, _ = ioutil.TempDir("", "") mountPoint, _ = ioutil.TempDir("", "")
state, _, err := nodefs.MountRoot(mountPoint, root, nil) state, _, err := nodefs.MountRoot(mountPoint, root, &nodefs.Options{})
state.SetDebug(VerboseTest()) state.SetDebug(VerboseTest())
go state.Serve() go state.Serve()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment