block completion races
Quoted 10 lines
Also, there is this code in
ide_do_drive_cmd():if (action == ide_wait) { wait_for_completion(&wait); /* wait for it to be serviced */ return rq->errors ? -EIO : 0; /* return -EIO if errors */ }Is it safe to use `rq' here? It has just been recycled in
end_that_request_last()and we don't own it any more.
Yes, this is safe. rq lies on the stack of the caller of ide_do_drive_cmd() - it can't disappear before we return.
--
Manfred
Quoted 7 lines · Manfred Spraul
Quoted 7 lines
Also, there is this code in
ide_do_drive_cmd():if (action == ide_wait) { wait_for_completion(&wait); /* wait for it to be serviced */ return rq->errors ? -EIO : 0; /* return -EIO if errors */ }
Quoted 6 lines
Quoted 3 lines
Is it safe to use `rq' here? It has just been recycled in
end_that_request_last()and we don't own it any more.Yes, this is safe. rq lies on the stack of the caller of
ide_do_drive_cmd()- it can't disappear before we return.
Duh yes of course, I was even preaching this on irc the other day :/
Signature · 1 line
Jens Axboe