Skip to content

Commit

Permalink
fusefrontend: unregister from openfiletable before closing the fd
Browse files Browse the repository at this point in the history
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
  • Loading branch information
rfjakob committed Oct 6, 2019
1 parent 4326594 commit 00af4f4
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions internal/fusefrontend/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 00af4f4

Please sign in to comment.