[parted-devel] [PATCH] libparted: Tell libdevmapper to retry remove when BUSY

Brian C. Lane bcl at redhat.com
Wed Aug 11 00:13:29 BST 2021


On Fri, Jul 09, 2021 at 11:50:57AM -0700, Brian C. Lane wrote:
> This sets the libdevmapper retry remove flag, which will retry a remove
> command if it is BUSY.
> 
> parted already has it's own BUSY retry code, but when run with
> device-mapper an error can be printed by libdevmapper which can be
> confusing to the user.
> 
> Resolves: rhbz#1980697
> ---
>  libparted/arch/linux.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c
> index aacc94f..758d36a 100644
> --- a/libparted/arch/linux.c
> +++ b/libparted/arch/linux.c
> @@ -2855,6 +2855,7 @@ _dm_remove_partition(PedDisk* disk, int partno)
>          if (!task)
>                  goto err;
>          dm_task_set_name (task, part_name);
> +        dm_task_retry_remove(task);
>          if (!dm_task_set_cookie (task, &cookie, 0))
>                  goto err;
>          rc = _dm_task_run_wait (task, cookie);
> -- 
> 2.31.1
> 
> 

Any objections to pushing this?

Brian

-- 
Brian C. Lane (PST8PDT) - weldr.io - lorax - parted - pykickstart




More information about the parted-devel mailing list