Re: IORING_OP_RECVMSG not respects non-blocking nature of the fd

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

 



On 3/16/21 8:00 AM, Norman Maurer wrote:
> Hi there,
> 
> I think I found a bug in the current io_uring implementation. It seems
> like recvmsg currently not respect when a fd is set to non-blocking.
> At the moment recvmsg never returns in this case. I can work around
> this by using MSG_DONTWAIT but I don’t think this should be needed.
> 
> I am using the latest 5.12 code base atm.

This is actually "by design" in that system calls that offer a "don't
block for this operation" (like MSG_DONTWAIT here) will not be looking
at the O_NONBLOCK flag. Though it is a bit confusing and potentially
inconsistent, my argument here is that this is the case for system calls
in general, where even O_NONBLOCK has very hazy semantics depending on
what system call you are looking at.

The issue is mostly around when to use -EAGAIN to arm async retry, and
when to return -EAGAIN to the application.

I'd like to hear from others here, but as far as io_uring is concerned,
we _should_ be consistent in how we treat O_NONBLOCK _depending_ on if
that system call allows a flags method of passing in nonblock behavior.

-- 
Jens Axboe




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux