[Devel] [PATCH RH7 1/5] ploop: Clear PLOOP_S_NO_FALLOC_DISCARD on restart

Kirill Tkhai ktkhai at virtuozzo.com
Thu Aug 27 18:44:18 MSK 2020


https://jira.sw.ru/browse/PSBM-105347

On 27.08.2020 18:40, Kirill Tkhai wrote:
> It looks there is no a better place to do that,
> since we do not remove device after it becomes
> unused (stop+last delta is removed).
> 
> This is indicator of cached ploop device was reused
> for another mount.
> 
> Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
> ---
>  drivers/block/ploop/dev.c |    4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/block/ploop/dev.c b/drivers/block/ploop/dev.c
> index 197faa5db05d..64127fa10c45 100644
> --- a/drivers/block/ploop/dev.c
> +++ b/drivers/block/ploop/dev.c
> @@ -3420,8 +3420,10 @@ static int ploop_add_delta(struct ploop_device * plo, unsigned long arg)
>  	if (err)
>  		goto out_destroy;
>  
> -	if (list_empty(&plo->map.delta_list))
> +	if (list_empty(&plo->map.delta_list)) {
>  		plo->fmt_version = PLOOP_FMT_UNDEFINED;
> +		clear_bit(PLOOP_S_NO_FALLOC_DISCARD, &delta->plo->state);
> +	}
>  
>  	err = delta->ops->open(delta);
>  	if (err)
> 
> 



More information about the Devel mailing list