fix(mount): don't release file handles from FUSE Forget (#9529)

fix(mount): don't release file handles from Forget

Forget(nodeid, nlookup) only decrements the kernel inode lookup count.
File handle lifecycle belongs to FUSE Open/Release. Driving the FH
refcount from Forget coupled two unrelated counters and could tear down
a still-live handle if Forget ever raced ahead of Release.

Drop the ReleaseByInode call (and the now-unused method).
This commit is contained in:
Chris Lu authored and GitHub committed 2026-05-18 01:02:58 -07:00
1 parent 01b3e4a71c
commit 4d04609bb8
2 files changed
+4 -31

No files matched your search

-25
View File
@@ -66,31 +66,6 @@ func (i *FileHandleToInode) AcquireFileHandle(wfs *WFS, inode uint64, entry *fil
return fh
}
func (i *FileHandleToInode) ReleaseByInode(inode uint64) *FileHandle {
i.Lock()
defer i.Unlock()
fh, found := i.inode2fh[inode]
if !found {
return nil
}
// If the counter is already <= 0, a prior Release already started the
// drain. Return nil to prevent double-processing (e.g. Forget after Release).
if fh.counter <= 0 {
return nil
}
fh.counter--
if fh.counter <= 0 {
if fh.asyncFlushPending {
// Handle stays in fhMap so rename/unlink can find it during drain.
return fh
}
delete(i.inode2fh, inode)
delete(i.fh2inode, fh.fh)
return fh
}
return nil
}
func (i *FileHandleToInode) ReleaseByHandle(fh FileHandleId) *FileHandle {
i.Lock()
defer i.Unlock()