fuse: add missing locking on filehandle read #823 #802

This commit is contained in:
Nick Craig-Wood 2016-10-27 09:57:52 +01:00
parent 5986953317
commit 87107413f5

View File

@ -69,6 +69,8 @@ func (fh *ReadFileHandle) seek(offset int64) error {
// Read from the file handle
func (fh *ReadFileHandle) Read(ctx context.Context, req *fuse.ReadRequest, resp *fuse.ReadResponse) error {
fh.mu.Lock()
defer fh.mu.Unlock()
fs.Debug(fh.o, "ReadFileHandle.Read size %d offset %d", req.Size, req.Offset)
if fh.closed {
fs.ErrorLog(fh.o, "ReadFileHandle.Read error: %v", errClosedFileHandle)