[PATCH] nvme: stop aer posting if controller state not live

Christoph Hellwig hch at infradead.org
Thu Sep 14 10:05:28 PDT 2017


>  	spin_lock_irq(&ctrl->lock);
> +	if (ctrl->state != NVME_CTRL_LIVE)
> +		goto skip_aer;
>  	while (ctrl->event_limit > 0) {

How about:

	while (ctrl->state == NVME_CTRL_LIVE && ctrl->event_limit > 0) {

That takes care of the case where the controller goes bad during
the loop (except of cours that currently there's only ever one AER)
and also is a lot more readable.



More information about the Linux-nvme mailing list