Skip to content

Commit 6651388

Browse files
committed
audisp: fix queue resize handshake
Reworked audisp/queue.c to remove the unused queue_lock, add the new enqueue_in_progress flag, and implement the producer/resizer two-flag handshake with seq_cst ordering under HAVE_ATOMIC, plus the matching fallback behavior for non-atomic builds. Updated q_depth and overflowed to use the same shared-state pattern as the other cross-thread queue counters by declaring them as ATOMIC_UNSIGNED. Replaced every bare read/write of q_depth with AUDIT_ATOMIC_LOAD/AUDIT_ATOMIC_STORE, including queue initialization, file restore, enqueue/dequeue index math, resize, state reporting, and teardown paths. Replaced every bare read/write of overflowed with AUDIT_ATOMIC_LOAD/AUDIT_ATOMIC_STORE, including overflow handling, resize reset, state reporting, teardown, and the public query helper. Updated the resize_handshake_test so it now models the real auditd threading design: one producer thread races with one dispatcher thread that both dequeues and performs the resize.
1 parent feade40 commit 6651388

2 files changed

Lines changed: 308 additions & 48 deletions

File tree

0 commit comments

Comments
 (0)