]> git.apps.os.sepia.ceph.com Git - ceph.git/log
ceph.git
2 years agolog: use non-blocking atomic writes to stderr fifos
Patrick Donnelly [Tue, 25 Oct 2022 15:42:10 +0000 (11:42 -0400)]
log: use non-blocking atomic writes to stderr fifos

Buggy container runtimes are known to do partial reads on container's
stderr and emit torn logs [1]. This is due to write(2) allowing partial
data transfer. One way to avoid this when stderr is a FIFO (which is the
case for container runtimes) is to change the file flags to set
O_NONBLOCK which alters the behavior of write(2) when the write size is
less than PIPE_BUF. This makes a write guaranteed to be atomic.

The small complexity added is to poll on stderr in this case whenever a
write(2) fails with EAGAIN. This does not block the log flush thread in
any new way. It would always block when the stderr FIFO was full.

[1] https://github.com/containers/conmon/issues/242

Fixes: cef04bc4ed0a3b1c1e9873fbbdd023b3bdf8af03
Fixes: https://tracker.ceph.com/issues/57923
Related: https://bugzilla.redhat.com/show_bug.cgi?id=1996599
Related: https://bugzilla.redhat.com/show_bug.cgi?id=2108228
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
2 years agolog: invalidate m_fd on close
Patrick Donnelly [Tue, 25 Oct 2022 14:26:36 +0000 (10:26 -0400)]
log: invalidate m_fd on close

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
2 years agolog: reorg header
Patrick Donnelly [Tue, 25 Oct 2022 14:24:55 +0000 (10:24 -0400)]
log: reorg header

To follow code style guidelines.

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
2 years agoMerge pull request #47874 from petrutlucian94/dokany_v2
Venky Shankar [Thu, 27 Oct 2022 12:48:36 +0000 (18:18 +0530)]
Merge pull request #47874 from petrutlucian94/dokany_v2

dokan: switch to Dokany v2

Reviewed-by: Venky Shankar <vshankar@redhat.com>
Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
Reviewed-by: Anthony D'Atri <anthony.datri@gmail.com>