Re: [PATCH v5 4/4] ublk: mark ublk_queue as const for ublk_handle_need_get_data
From: Caleb Sander Mateos
Date: Wed Apr 16 2025 - 15:55:36 EST
On Wed, Apr 16, 2025 at 12:46 PM Uday Shankar <ushankar@xxxxxxxxxxxxxxx> wrote:
>
> We now allow multiple tasks to operate on I/Os belonging to the same
> queue concurrently. This means that any writes to ublk_queue in the I/O
> path are potential sources of data races. Try to prevent these by
> marking ublk_queue pointers as const in ublk_handle_need_get_data. Also
> move a bit more of the NEED_GET_DATA-specific logic into
> ublk_handle_need_get_data, to make the pattern in __ublk_ch_uring_cmd
> more uniform.
>
> Suggested-by: Ming Lei <ming.lei@xxxxxxxxxx>
> Signed-off-by: Uday Shankar <ushankar@xxxxxxxxxxxxxxx>
Reviewed-by: Caleb Sander Mateos <csander@xxxxxxxxxxxxxxx>