aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Unterwurzacher2016-05-05 13:38:39 +0200
committerJakob Unterwurzacher2016-05-05 13:38:39 +0200
commit730291feabdcdbd6345aa12ddba87a3ffea4ecb1 (patch)
tree1634fb25289f661c36d519e5a0690edfaa0c5d4d
parente97962bd3f9ef8cb9fbd57bd2a2424b1cc28ec75 (diff)
fusefrontend: fix wlock memory leak
The write lock was not freed on release, causing a slow memory leak. This was noticed by running extractloop.bash for 10 hours.
-rw-r--r--internal/fusefrontend/file.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/internal/fusefrontend/file.go b/internal/fusefrontend/file.go
index 0d26329..d9588e9 100644
--- a/internal/fusefrontend/file.go
+++ b/internal/fusefrontend/file.go
@@ -302,9 +302,10 @@ func (f *file) Write(data []byte, off int64) (uint32, fuse.Status) {
// Release - FUSE call, close file
func (f *file) Release() {
f.fdLock.Lock()
- defer f.fdLock.Unlock()
-
f.fd.Close()
+ f.fdLock.Unlock()
+
+ wlock.unregister(f.ino)
f.forgotten = true
}