[PATCH] nvme_fc: replace ioabort msleep loop with completion

Christoph Hellwig hch at infradead.org
Wed May 10 10:22:21 PDT 2017


> +			if (!(--ctrl->iocnt))

No need for the inner braces here.

> -	while (ctrl->iocnt) {
> +	if (ctrl->iocnt) {
> +		init_completion(&ctrl->ioaborts_done);
>  		spin_unlock_irqrestore(&ctrl->lock, flags);
> -		msleep(1000);
> +
> +		wait_for_completion(&ctrl->ioaborts_done);
> +
>  		spin_lock_irqsave(&ctrl->lock, flags);
> +		WARN_ON(ctrl->iocnt);

But more importantly the single wait is potentially wrong.  Please
switch to a waitqueue and use wait_event_lock_irq here.



More information about the Linux-nvme mailing list