summaryrefslogtreecommitdiff
path: root/rust/kernel/alloc/kvec/errors.rs
diff options
context:
space:
mode:
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>2026-09-20 19:47:45 +0900
committerTakashi Sakamoto <o-takashi@sakamocchi.jp>2026-09-20 19:47:45 +0900
commite64f2d4de1f344b84c0fa0bebf3102a8fac48b33 (patch)
tree06284d8b54f4d4b2545cc957d3ee3d12b978f9f7 /rust/kernel/alloc/kvec/errors.rs
parentab2a823af3d4bc35785fec56103f59796bd94ec1 (diff)
firewire: core: consolidate lock scopes for event waiting in dequeue function
Current implementation uses the spinlock in the card structure to serialize accesses to the event list. The dequeue_event() function yields the CPU while waiting for the condition to become true, but checks the list without acquiring the spinlock. It acquires the spinlock when operating the list, however it assumes that the list has at least one entry. This can cause problems when multiple threads execute read(2) system calls concurrently, since the list can become empty after rescheduling but before the list operation, depending on the scheduling order of the two threads. Use a wait_event variant that reacquires the lock after being rescheduled, before checking the condition. Link: https://lore.kernel.org/r/20260920104745.212753-1-o-takashi@sakamocchi.jp Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Diffstat (limited to 'rust/kernel/alloc/kvec/errors.rs')
0 files changed, 0 insertions, 0 deletions