mirror of
https://github.com/cubefs/cubefs.git
synced 2026-08-02 02:00:56 +00:00
fix(clinet): remove node for dir when released
Signed-off-by: chihe <chihe@oppo.com>
This commit is contained in:
parent
6c23d05e80
commit
78fb534ef3
@ -79,3 +79,12 @@ func (dc *DentryCache) Len() int {
|
||||
defer dc.Unlock()
|
||||
return len(dc.cache)
|
||||
}
|
||||
|
||||
func (dc *DentryCache) Clear() {
|
||||
if dc == nil {
|
||||
return
|
||||
}
|
||||
dc.Lock()
|
||||
defer dc.Unlock()
|
||||
dc.cache = nil
|
||||
}
|
||||
|
||||
@ -164,6 +164,13 @@ func (d *Dir) Release(ctx context.Context, req *fuse.ReleaseRequest) (err error)
|
||||
log.LogDebugf("TRACE Release exit: ino(%v) name(%v)", d.info.Inode, d.name)
|
||||
}()
|
||||
d.dctx.Clear()
|
||||
d.dcache.Clear()
|
||||
ino := d.info.Inode
|
||||
d.super.ic.Delete(ino)
|
||||
d.super.fslock.Lock()
|
||||
delete(d.super.nodeCache, ino)
|
||||
d.super.fslock.Unlock()
|
||||
d.super.mw.DeleteInoInfoCache(ino)
|
||||
|
||||
return nil
|
||||
}
|
||||
@ -220,7 +227,7 @@ func (d *Dir) Forget() {
|
||||
}()
|
||||
|
||||
d.super.ic.Delete(ino)
|
||||
|
||||
d.dcache.Clear()
|
||||
d.super.fslock.Lock()
|
||||
delete(d.super.nodeCache, ino)
|
||||
d.super.fslock.Unlock()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user