Hi Stefan, Am 16.10.25 um 8:25 PM schrieb Stefan Hajnoczi: > On Wed, Oct 15, 2025 at 03:43:50PM +0200, Fiona Ebner wrote: >> RFC, because it's a naive approach, maybe somebody has a better idea? > > Another approach is the one taken in scsi_device_for_each_req_async_bh() > where requests from this AioContext are collected into a GList and then > processed after releasing s->requests_lock. It's safe because the > function runs in the request's AioContext and we know nothing else can > modify the request while we are running. The same constraint applies in > this case too. > > That solution is more localized because various function prototypes > don't need to be extended with holds_requests_lock. Either it can be > open coded inside virtio_scsi_do_tmf_aio_context() or you could extract > a helper function from scsi_device_for_each_req_async_bh() in scsi-bus.c > and call the new helper from virtio_scsi_do_tmf_aio_context(). > > I slightly prefer a localized fix so that other parts of the codebase > don't need to worry about whether or not requests_lock is held. Do you > want to try implementing that? thank you for the suggestion and pointers! I also feel like a localized solution would be nicer. I'll try this approach.
Kind Regards, Fiona
