Skip to content

Commit

Permalink
Check type before cache eviction
Browse files Browse the repository at this point in the history
Co-authored-by: Gianmaria Del Monte <g.macmount@gmail.com>
  • Loading branch information
javfg and gmgigi96 committed Sep 25, 2023
1 parent 3cf929f commit 349e33c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pkg/storage/fs/cephfs/connections.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,11 @@ func newCache() (c *connections, err error) {
MaxCost: usrLimit,
BufferItems: 64,
OnEvict: func(item *ristretto.Item) {
v := item.Value.(*cacheVal)
v.perm.Destroy()
_ = v.mount.Unmount()
_ = v.mount.Release()
if v, ok := item.Value.(*cacheVal); ok {
v.perm.Destroy()
_ = v.mount.Unmount()
_ = v.mount.Release()
}
},
})
if err != nil {
Expand Down

0 comments on commit 349e33c

Please sign in to comment.