Skip to content

Commit 00af4f4

Browse files
committed
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 #363
1 parent 4326594 commit 00af4f4

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

internal/fusefrontend/file.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -401,11 +401,10 @@ func (f *File) Release() {
401401
if f.released {
402402
log.Panicf("ino%d fh%d: double release", f.qIno.Ino, f.intFd())
403403
}
404-
f.fd.Close()
405404
f.released = true
406-
f.fdLock.Unlock()
407-
408405
openfiletable.Unregister(f.qIno)
406+
f.fd.Close()
407+
f.fdLock.Unlock()
409408
}
410409

411410
// Flush - FUSE call

0 commit comments

Comments
 (0)