Hi Mathieu,

Mathieu Othacehe <othac...@gnu.org> skribis:

> From 6fec27303d0f8767ed48c507af67908a0fcf17a0 Mon Sep 17 00:00:00 2001
> From: Mathieu Othacehe <othac...@gnu.org>
> Date: Mon, 16 Nov 2020 10:10:56 +0100
> Subject: [PATCH] Increase device use delay.
>
> ---
>  gnu/installer/parted.scm | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/gnu/installer/parted.scm b/gnu/installer/parted.scm
> index f2352c5779..ed3af6af85 100644
> --- a/gnu/installer/parted.scm
> +++ b/gnu/installer/parted.scm
> @@ -318,7 +318,7 @@ PARTED-OBJECT field equals PARTITION, return #f if not 
> found."
>  fail. See rereadpt function in wipefs.c of util-linux for an explanation."
>    ;; Kernel always return EINVAL for BLKRRPART on loopdevices.
>    (and (not (string-match "/dev/loop*" file-name))
> -       (let loop ((try 4))
> +       (let loop ((try 16))
>           (usleep 250000)
>           (let ((in-use? (device-in-use? file-name)))
>             (if (and in-use? (> try 0))

Should we go ahead and apply this one?  Not polling would be nicer, but
maybe there’s no real way to do that?

BTW:

  (string-match "/dev/loop*" file-name)

should almost certainly be:

  (string-prefix? "/dev/loop" file-name)

The regexp above would match “/dev/loo”, “qux/dev/looppppppppabc”, etc.

WDYT?

Thanks,
Ludo’.

Reply via email to