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
This commit is contained in:
parent
43265940fa
commit
00af4f4864
|
@ -401,11 +401,10 @@ func (f *File) Release() {
|
||||||
if f.released {
|
if f.released {
|
||||||
log.Panicf("ino%d fh%d: double release", f.qIno.Ino, f.intFd())
|
log.Panicf("ino%d fh%d: double release", f.qIno.Ino, f.intFd())
|
||||||
}
|
}
|
||||||
f.fd.Close()
|
|
||||||
f.released = true
|
f.released = true
|
||||||
f.fdLock.Unlock()
|
|
||||||
|
|
||||||
openfiletable.Unregister(f.qIno)
|
openfiletable.Unregister(f.qIno)
|
||||||
|
f.fd.Close()
|
||||||
|
f.fdLock.Unlock()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Flush - FUSE call
|
// Flush - FUSE call
|
||||||
|
|
Loading…
Reference in New Issue