diff options
author | Jakob Unterwurzacher | 2019-10-06 21:27:38 +0200 |
---|---|---|
committer | Jakob Unterwurzacher | 2019-10-06 21:47:36 +0200 |
commit | 00af4f48643f0533b6cfbd14fdf5186c844f8f5d (patch) | |
tree | 1ffbd671b1a82e9d8aa086d11abdce17a940029b | |
parent | 43265940fa2d43ebea8edb00373aa4d6718e2ea7 (diff) |
fusefrontend: unregister from openfiletable before closing the fd
Closing the fd means the inode number may be reused immediately
by a new file, so we have to get the old fileID out of the table
beforehand!
Hopefully fixes https://github.com/rfjakob/gocryptfs/issues/363
-rw-r--r-- | internal/fusefrontend/file.go | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/internal/fusefrontend/file.go b/internal/fusefrontend/file.go index 3313934..74a56c3 100644 --- a/internal/fusefrontend/file.go +++ b/internal/fusefrontend/file.go @@ -401,11 +401,10 @@ func (f *File) Release() { if f.released { log.Panicf("ino%d fh%d: double release", f.qIno.Ino, f.intFd()) } - f.fd.Close() f.released = true - f.fdLock.Unlock() - openfiletable.Unregister(f.qIno) + f.fd.Close() + f.fdLock.Unlock() } // Flush - FUSE call |