mount: check possible nil entry case

This commit is contained in:
chrislu
2022-07-22 15:33:37 -07:00
parent 0716092b39
commit a5c94acd4f
2 changed files with 10 additions and 1 deletions

View File

@@ -106,6 +106,9 @@ func (wfs *WFS) SetXAttr(cancel <-chan struct{}, input *fuse.SetXAttrIn, attr st
if status != fuse.OK {
return status
}
if entry == nil {
return fuse.ENOENT
}
if fh != nil {
fh.entryLock.Lock()
defer fh.entryLock.Unlock()
@@ -181,6 +184,9 @@ func (wfs *WFS) RemoveXAttr(cancel <-chan struct{}, header *fuse.InHeader, attr
if status != fuse.OK {
return status
}
if entry == nil {
return fuse.OK
}
if fh != nil {
fh.entryLock.Lock()
defer fh.entryLock.Unlock()