From 618b2f6829af2bbf8cfed3a543ee13f675bd8efd Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Tue, 18 Aug 2020 12:53:08 -0700 Subject: [PATCH] release resources only when needed to --- weed/filesys/filehandle.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/weed/filesys/filehandle.go b/weed/filesys/filehandle.go index 1cbe120ac..fa31cd81b 100644 --- a/weed/filesys/filehandle.go +++ b/weed/filesys/filehandle.go @@ -167,9 +167,9 @@ func (fh *FileHandle) Release(ctx context.Context, req *fuse.ReleaseRequest) err if fh.f.isOpen <= 0 { fh.dirtyPages.releaseResource() fh.f.wfs.ReleaseHandle(fh.f.fullpath(), fuse.HandleID(fh.handle)) + fh.f.entryViewCache = nil + fh.f.reader = nil } - fh.f.entryViewCache = nil - fh.f.reader = nil return nil }