On Thursday, March 20, 2025 1:16:20 PM CET Christian Schoenebeck wrote: > According to 'man 2 close' errors returned by close() should only be used > for either diagnostic purposes or for catching data loss due to a previous > write error, as an error result of close() usually indicates a deferred > error of a previous write operation. > > Therefore not decrementing 'total_open_fd' on a close() error is wrong > and would yield in a higher open file descriptor count than actually the > case, leading to 9p server reclaiming open file descriptors too soon. > > Based-on: <[email protected]> > Signed-off-by: Christian Schoenebeck <[email protected]> > --- > V2: log a warning message on unexpected close() -> EBADF case > > hw/9pfs/9p.c | 10 +++++++++- > hw/9pfs/codir.c | 7 ++++++- > hw/9pfs/cofile.c | 7 ++++++- > 3 files changed, 21 insertions(+), 3 deletions(-)
Queued on 9p.next: https://github.com/cschoenebeck/qemu/commits/9p.next Thanks! /Christian
