Skip to content

Commit

Permalink
Unlock mutex before returning
Browse files Browse the repository at this point in the history
  • Loading branch information
iain-macdonald committed Sep 12, 2023
1 parent 6fc9745 commit 3451bf5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion fs/layer/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,9 @@ func (n *node) readdir() ([]fuse.DirEntry, syscall.Errno) {

n.entsMu.Lock()
if n.entsCached {
return n.ents, 0
ents := n.ents
n.entsMu.Unlock()
return ents, 0
}
n.entsMu.Unlock()

Expand Down Expand Up @@ -428,6 +430,7 @@ func (n *node) Lookup(ctx context.Context, name string, out *fuse.EntryOut) (*fu
}
}
if !found {
n.entsMu.Unlock()
return nil, syscall.ENOENT
}
}
Expand Down

0 comments on commit 3451bf5

Please sign in to comment.