public inbox for io-uring@vger.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Bart Van Assche <bvanassche@acm.org>, Stefan Roesch <shr@fb.com>,
	kernel-team@fb.com, linux-block@vger.kernel.org
Cc: io-uring@vger.kernel.org
Subject: Re: [PATCH v1] block: blk_queue_enter() / __bio_queue_enter() must return -EAGAIN for nowait
Date: Mon, 12 Sep 2022 11:22:02 -0600	[thread overview]
Message-ID: <601dac34-c3e3-5e86-852f-aaa489226733@kernel.dk> (raw)
In-Reply-To: <24aad185-fc3e-420b-b638-227c4564bcf8@acm.org>

On 9/12/22 11:14 AM, Bart Van Assche wrote:
> On 9/12/22 09:53, Stefan Roesch wrote:
>> Today blk_queue_enter() and __bio_queue_enter() return -EBUSY for the
>> nowait code path. This is not correct: they should return -EAGAIN
>> instead.
> 
> Why is this considered incorrect? Please explain.
> 
> Since this patch also affects other code, e.g. NVMe pass-through, can
> this patch break existing user space code by changing the value
> returned to user space?

It is currently broken because we always return EAGAIN/EWOULDBLOCK for
these cases, if a non-block flag is set of some sort. I strongly suspect
that nobody has really being doing non-blocking IO to devices before
io_uring made it a lot more common. EAGAIN means "try again later, or
without nonblock said".

We should be consistent here.

-- 
Jens Axboe

  reply	other threads:[~2022-09-12 17:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-12 16:53 [PATCH v1] block: blk_queue_enter() / __bio_queue_enter() must return -EAGAIN for nowait Stefan Roesch
2022-09-12 17:14 ` Bart Van Assche
2022-09-12 17:22   ` Jens Axboe [this message]
2022-09-13 21:08 ` Jens Axboe

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=601dac34-c3e3-5e86-852f-aaa489226733@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=bvanassche@acm.org \
    --cc=io-uring@vger.kernel.org \
    --cc=kernel-team@fb.com \
    --cc=linux-block@vger.kernel.org \
    --cc=shr@fb.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox