util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Romain Izard <romain.izard.pro@gmail.com>
To: Karel Zak <kzak@redhat.com>
Cc: util-linux@vger.kernel.org, linux-block@vger.kernel.org
Subject: Re: [PATCH] lib/loopdev.c: Retry LOOP_SET_STATUS64 on EAGAIN
Date: Fri, 3 May 2019 14:10:49 +0200	[thread overview]
Message-ID: <CAGkQfmMvgPqAYm2ZD1JDcM+hanm97a8WxL35xkBrFgFRGGUnzQ@mail.gmail.com> (raw)
In-Reply-To: <20190503104227.ga56ffjkrm2gno7h@ws.net.home>

Le ven. 3 mai 2019 à 12:42, Karel Zak <kzak@redhat.com> a écrit :
>
> On Fri, May 03, 2019 at 10:28:19AM +0200, Romain Izard wrote:
> > +     do {
> > +             err = ioctl(dev_fd, LOOP_SET_STATUS64, &lc->info);
> > +     } while (err && errno == EAGAIN);
>
>  Would be better to use any delay in the loop? For example after
>  EAGAIN read/write we use usleep(250000).

As we are waiting for the kernel to do some cleanup, this is a good idea.
It seems to reduce the need for retries in my use case.

I will add this in a v2.

Best regards,
-- 
Romain Izard

      reply	other threads:[~2019-05-03 12:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-03  8:28 [PATCH] lib/loopdev.c: Retry LOOP_SET_STATUS64 on EAGAIN Romain Izard
2019-05-03 10:42 ` Karel Zak
2019-05-03 12:10   ` Romain Izard [this message]

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=CAGkQfmMvgPqAYm2ZD1JDcM+hanm97a8WxL35xkBrFgFRGGUnzQ@mail.gmail.com \
    --to=romain.izard.pro@gmail.com \
    --cc=kzak@redhat.com \
    --cc=linux-block@vger.kernel.org \
    --cc=util-linux@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).