On 2/16/20 4:06 PM, Jens Axboe wrote: >>> + else if (!retry_count) >>> + goto done_req; >>> + INIT_IO_WORK(&req->work, io_wq_submit_work); >> >> It's not nice to reset it as this: >> - prep() could set some work.flags >> - custom work.func is more performant (adds extra switch) >> - some may rely on specified work.func to be called. e.g. close(), even though >> it doesn't participate in the scheme > > For now I just retain a copy of ->work, seems to be the easiest solution > vs trying to track this state. Should mention this isn't quite enough, we really need to drop anything we have in ->work as well if it was already prepared/grabbed. -- Jens Axboe