[PATCH] nvme: Prevent controller state invalid transition

Jens Axboe axboe at kernel.dk
Mon Aug 15 08:47:29 PDT 2016


On 07/29/2016 01:15 PM, Gabriel Krisman Bertazi wrote:
> Acquiring the nvme_ctrl lock before reading ctrl->state in
> nvme_change_ctrl_state() should prevent a theoretical invalid state
> transition, in the event of two threads racing inside that function.
>
> I haven't been able to observe this happening with the current code, and
> the current state machine seems to be simple enough to not be
> affected by these invalid transitions, but future modifications could
> make it more likely to happen.

Applied, thanks.

-- 
Jens Axboe



More information about the Linux-nvme mailing list