All of lore.kernel.org
 help / color / mirror / Atom feed
From: Karel Zak <kzak@redhat.com>
To: Ingo Franzki <ifranzki@linux.ibm.com>
Cc: Ming Lei <ming.lei@redhat.com>, Jens Axboe <axboe@kernel.dk>,
	linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
	Juergen Christ <jchrist@linux.ibm.com>
Subject: Re: loop_set_block_size: loop0 () has still dirty pages (nrpages=2)
Date: Tue, 15 Jun 2021 10:42:59 +0200	[thread overview]
Message-ID: <20210615084259.yj5pmyjonfqcg7lg@ws.net.home> (raw)
In-Reply-To: <cf3c803f-350e-c365-afac-0a07a9b6cee2@linux.ibm.com>

On Mon, Jun 14, 2021 at 09:35:30AM +0200, Ingo Franzki wrote:
> However, shouldn't then the losetup userspace utility implement some kind of retry logic in case of -EAGAIN ?
> I don't see that in the source of losetup.c nor in loopdev.c in the util-linux package. There is a retry loop in create_loop() in losetup.c retrying loopcxt_setup_device() in case of EBUSY, but not in case of EAGAIN.
> 
> And losetup also hides the original error code and just returns EXIT_FAILURE in case of a failure. So no real good chance for the script that uses losetup to catch that error situation and perform a retry itself.
> 
> Adding Karel Zak (the maintainer of util-linux).
> 
> @Karel Zak: How about adding EAGAIN to the condition for performing a retry? 
> 
> Something like this:
> 
> -		if (errno == EBUSY && !hasdev && ntries < 64) {
> +		if ((errno == EBUSY || errno == EAGAIN) && !hasdev && ntries < 64) {
> 			xusleep(200000);
> 			ntries++;
> 			continue;
> 		}
 
EAGAIN sounds like the best reason to try it again :-) 

Committed, it will be also available in v2.37.1.

  Karel


-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com


  parent reply	other threads:[~2021-06-15  8:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-08 12:01 loop_set_block_size: loop0 () has still dirty pages (nrpages=2) Ingo Franzki
2021-06-10 14:45 ` Ming Lei
2021-06-14  7:35   ` Ingo Franzki
2021-06-14 22:37     ` Ming Lei
2021-06-15  8:06       ` Jan Kara
2021-06-15  8:42     ` Karel Zak [this message]
2021-06-16  7:22       ` Ingo Franzki
2021-06-16  7:44         ` Karel Zak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210615084259.yj5pmyjonfqcg7lg@ws.net.home \
    --to=kzak@redhat.com \
    --cc=axboe@kernel.dk \
    --cc=ifranzki@linux.ibm.com \
    --cc=jchrist@linux.ibm.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ming.lei@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.