[Devel] [RFC PATCH vz9 v6 42/62] dm-ploop: properly end pios attached to piwb pios

Pavel Tikhomirov ptikhomirov at virtuozzo.com
Fri Jan 17 11:23:42 MSK 2025


Seems like an excess patch (leads to double ploop_pio_endio), as the 
only caller of ploop_data_pio_end already does:

         if (pio->is_data_alloc) {
                 completed = ploop_data_pio_end(pio);
                 if (!completed)
                         return;
         }

         ploop_pio_endio(pio);

On 12/6/24 05:56, Alexander Atanasov wrote:
> Fix a bug in ploop_data_pio_end.
> 
> If piwb is already completed, which can happen if we attach
> a flush pio to it, pio is not added to the list and ploop_pio_endio
> is never called on it. This results in a hang since pio is never completed.
> 
> Avoid this by calling ploop_pio_endio directly in case piwb is
> already completed.
> 
> https://virtuozzo.atlassian.net/browse/VSTOR-91821
> Signed-off-by: Alexander Atanasov <alexander.atanasov at virtuozzo.com>
> ---
>   drivers/md/dm-ploop-map.c | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/md/dm-ploop-map.c b/drivers/md/dm-ploop-map.c
> index 6192ddca3693..276e8cf3b178 100644
> --- a/drivers/md/dm-ploop-map.c
> +++ b/drivers/md/dm-ploop-map.c
> @@ -1204,6 +1204,9 @@ static bool ploop_data_pio_end(struct pio *pio)
>   	else if (!pio->bi_status)
>   		pio->bi_status = piwb->bi_status;
>   	spin_unlock_irqrestore(&piwb->lock, flags);
> +	/* If pio is late then end it here. this can happen with flushes */
> +	if (completed)
> +		ploop_pio_endio(pio);
>   
>   	ploop_put_piwb(piwb);
>   

-- 
Best regards, Tikhomirov Pavel
Senior Software Developer, Virtuozzo.



More information about the Devel mailing list