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
libgocryptfs
Jakob Unterwurzacher 4 years ago
parent 43265940fa
commit 00af4f4864

@ -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

Loading…
Cancel
Save