From: Christian Schoenebeck <qemu_oss@crudebyte.com>
To: qemu-devel@nongnu.org
Cc: Greg Kurz <groug@kaod.org>
Subject: Re: [PATCH v2] 9pfs: fix 'total_open_fd' decrementation
Date: Fri, 21 Mar 2025 11:10:31 +0100 [thread overview]
Message-ID: <10824792.3hV6cDByjg@silver> (raw)
In-Reply-To: <E1tvEyJ-004dMa-So@kylie.crudebyte.com>
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: <20250312152933.383967-7-groug@kaod.org>
> Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
> ---
> 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
prev parent reply other threads:[~2025-03-21 10:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-20 12:16 [PATCH v2] 9pfs: fix 'total_open_fd' decrementation Christian Schoenebeck
2025-03-20 14:34 ` Greg Kurz
2025-03-21 10:10 ` Christian Schoenebeck [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=10824792.3hV6cDByjg@silver \
--to=qemu_oss@crudebyte.com \
--cc=groug@kaod.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.