Re: [PATCH v1] block: blk_queue_enter() / __bio_queue_enter() must return -EAGAIN for nowait

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux