From: "Denis V. Lunev" <den@openvz.org>
To: khorenko@virtuozzo.com
Cc: devel@openvz.org
Subject: [Devel] [PATCH hci-8.1 0/2] ve/vtty: wait for a closing CT tty in the kernel, drop the EAGAIN return
Date: Mon, 2 Nov 2026 18:15:02 +0100 [thread overview]
Message-ID: <20261102171504.3809155-1-den@openvz.org> (raw)
In-Reply-To: <ba5a9a50-77a1-4aab-9aa1-5d59a86f66ac@virtuozzo.com>
Konstantin pointed out that the applied "ve/vtty: fix console attach
failing with EBUSY while the CT closes the tty" fixes the race only
for a vzctl which retries on EAGAIN, and every vzctl in the field
does not. Following his suggestion, this series replaces it with a
wait inside vtty_open_master(), as tty_open() does since
7f22f6c935cd. Patch 1 reverts the EAGAIN return, patch 2 waits for
the closing pair. The vzctl change "vzctl console: retry opening a
CT tty the CT is still closing" is no longer needed.
A signal ends the wait with -ERESTARTSYS rather than -EAGAIN: the
ioctl restarts under SA_RESTART and fails with EINTR otherwise, and
EAGAIN does not leak back to userspace.
Tested on dev-cl04, .22.15 with both patches, installed vzctl-10.0.147
which does not retry:
- "vzctl console" in a loop while a loop in the CT opens and closes the
same tty: 63 of 300 attaches fail with EBUSY on stock .22.11, all 300
attach with the series;
- a second VE_CONFIGURE_OPEN_TTY while a console is attached still
fails with EBUSY at once;
- the same race under a 50 us SIGALRM storm does not hang: the
interrupted opens fail with EINTR, and with SA_RESTART none fail;
- ve_vtty_stress, without its EAGAIN allowance, passes;
- nothing in dmesg.
Denis V. Lunev (2):
Revert "ve/vtty: fix console attach failing with EBUSY while the CT
closes the tty"
ve/vtty: wait for a closing CT tty instead of failing the console
attach
drivers/tty/pty.c | 16 ++++++++++++----
tools/testing/selftests/ve/ve_vtty_stress.c | 2 +-
2 files changed, 13 insertions(+), 5 deletions(-)
--
2.53.0
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel
next prev parent reply other threads:[~2026-11-02 17:40 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-29 22:35 [Devel] [PATCH hci-8.1] ve/vtty: fix console attach failing with EBUSY while the CT closes the tty Denis V. Lunev
2026-10-29 22:38 ` no-reply
2026-11-02 10:41 ` Konstantin Khorenko
2026-11-02 10:42 ` Konstantin Khorenko
2026-11-02 15:17 ` Konstantin Khorenko
2026-11-02 17:15 ` Denis V. Lunev [this message]
2026-11-02 17:15 ` [Devel] [PATCH hci-8.1 1/2] Revert "ve/vtty: fix console attach failing with EBUSY while the CT closes the tty" Denis V. Lunev
2026-11-02 17:48 ` no-reply
2026-11-02 17:15 ` [Devel] [PATCH hci-8.1 2/2] ve/vtty: wait for a closing CT tty instead of failing the console attach Denis V. Lunev
2026-11-02 17:51 ` no-reply
2026-11-02 18:09 ` Vladimir Riabchun
2026-11-03 12:42 ` Denis V. Lunev
2026-11-03 15:54 ` [Devel] [PATCH hci-8.1 0/2] ve/vtty: wait for a closing CT tty in the kernel, drop the EAGAIN return Konstantin Khorenko
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=20261102171504.3809155-1-den@openvz.org \
--to=den@openvz.org \
--cc=devel@openvz.org \
--cc=khorenko@virtuozzo.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox