Commit 5719e282 authored by Jann Horn's avatar Jann Horn Committed by Jens Axboe
Browse files

io_uring/rsrc: Simplify buffer cloning by locking both rings



The locking in the buffer cloning code is somewhat complex because it goes
back and forth between locking the source ring and the destination ring.

Make it easier to reason about by locking both rings at the same time.
To avoid ABBA deadlocks, lock the rings in ascending kernel address order,
just like in lock_two_nondirectories().

Signed-off-by: default avatarJann Horn <jannh@google.com>
Link: https://lore.kernel.org/r/20250115-uring-clone-refactor-v2-1-7289ba50776d@google.com


Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 95ec54a4
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment