FUSE mount: clean up file handles during renaming

resolve dir rename when file is still open. Need to clean the file handles as soon as possible.

These can happen out of order:
file rename, then file release
file release, then file rename
This commit is contained in:
Chris Lu 2020-06-28 13:41:00 -07:00
parent 95a1860d65
commit 42a338d7b0

View file

@ -42,6 +42,7 @@ func (dir *Dir) Rename(ctx context.Context, req *fuse.RenameRequest, newDirector
// fmt.Printf("rename path: %v => %v\n", oldPath, newPath)
dir.wfs.fsNodeCache.Move(oldPath, newPath)
delete(dir.wfs.handles, oldPath.AsInode())
}