Commit c38f937e authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

fuse/nodefs: elucidate locking constraints.

parent d25a1333
......@@ -122,8 +122,9 @@ func (f *loopbackFile) String() string {
}
func (f *loopbackFile) Read(buf []byte, off int64) (res fuse.ReadResult, code fuse.Status) {
// TODO - this is racy. The lock should be taken when the Fd is spliced.
f.lock.Lock()
// This is not racy by virtue of the kernel properly
// synchronizing the open/write/close.
r := fuse.ReadResultFd(f.File.Fd(), off, len(buf))
f.lock.Unlock()
return r, fuse.OK
......
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