]> git.ipfire.org Git - thirdparty/qemu.git/commit
9pfs: fix 'total_open_fd' decrementation
authorChristian Schoenebeck <qemu_oss@crudebyte.com>
Thu, 20 Mar 2025 12:16:20 +0000 (13:16 +0100)
committerChristian Schoenebeck <qemu_oss@crudebyte.com>
Mon, 5 May 2025 09:28:29 +0000 (11:28 +0200)
commitcdafeda35709ddf8cd982a7eb653c2a5028c8074
tree501595a3da3136a9ac157b58bfe3fd45dc5b1e2c
parent610dc187e52605c8ea8d14c5e7d8e7384f8af290
9pfs: fix 'total_open_fd' decrementation

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: <20250312152933.383967-7-groug@kaod.org>
Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
Reviewed-by: Greg Kurz <groug@kaod.org>
Message-Id: <E1tvEyJ-004dMa-So@kylie.crudebyte.com>
hw/9pfs/9p.c
hw/9pfs/codir.c
hw/9pfs/cofile.c