[lxc/lxc] 4cb988: lxc/{terminal, file_utils}: ensure complete data w...

0 views
Skip to first unread message

Stéphane Graber

unread,
Jan 22, 2026, 11:34:08 AM (13 days ago) Jan 22
to lxc-...@lists.linuxcontainers.org
Branch: refs/heads/main
Home: https://github.com/lxc/lxc
Commit: 4cb9884ed7d3ca98ccd9bf2abbd508255b4e1fb7
https://github.com/lxc/lxc/commit/4cb9884ed7d3ca98ccd9bf2abbd508255b4e1fb7
Author: DreamConnected <14874...@qq.com>
Date: 2026-01-22 (Thu, 22 Jan 2026)

Changed paths:
M src/lxc/file_utils.c
M src/lxc/file_utils.h
M src/lxc/terminal.c

Log Message:
-----------
lxc/{terminal, file_utils}: ensure complete data writes in ptx/peer io handlers

Previously, lxc_write_nointr could return without writing all data
when write() returned EAGAIN/EWOULDBLOCK due to buffer full conditions.

This change:
- Implements a loop to continue writing until all data is sent
- Handles EINTR, EAGAIN, and EWOULDBLOCK errors appropriately
- Uses poll() to wait for fd to become ready when blocked
- Maintains backward compatibility while fixing partial write issues

Signed-off-by: DreamConnected <14874...@qq.com>
[ alex ]
- introduce a separate helper lxc_write_all and use it only in ptx/peer
io handlers
- cleanup the code a bit
Signed-off-by: Alexander Mikhalitsyn <aleksandr....@futurfusion.io>


Commit: 97bd7699c79493f32fcee0f976b6c397cf0f0ad5
https://github.com/lxc/lxc/commit/97bd7699c79493f32fcee0f976b6c397cf0f0ad5
Author: Alexander Mikhalitsyn <aleksandr....@futurfusion.io>
Date: 2026-01-22 (Thu, 22 Jan 2026)

Changed paths:
M src/tests/lxc-test-lxc-attach

Log Message:
-----------
tests/lxc-attach: ensure no data corruption happens during heavy IO on pts

Signed-off-by: Alexander Mikhalitsyn <aleksandr....@futurfusion.io>


Commit: ad528f654aed5ad15089909d109086abaa71083f
https://github.com/lxc/lxc/commit/ad528f654aed5ad15089909d109086abaa71083f
Author: Stéphane Graber <stgr...@stgraber.org>
Date: 2026-01-22 (Thu, 22 Jan 2026)

Changed paths:
M src/lxc/file_utils.c
M src/lxc/file_utils.h
M src/lxc/terminal.c
M src/tests/lxc-test-lxc-attach

Log Message:
-----------
Merge pull request #4633 from mihalicyn/fix_terminal_data_corruption

lxc-attach: fix data corruption during heavy IO on PTS


Compare: https://github.com/lxc/lxc/compare/5d9839bc1316...ad528f654aed

To unsubscribe from these emails, change your notification settings at https://github.com/lxc/lxc/settings/notifications
Reply all
Reply to author
Forward
0 new messages