Re: [RFC] splice/tee: len=0 fast path after validity check

From: Pavel Begunkov
Date: Sat May 09 2020 - 12:04:21 EST


On 09/05/2020 17:42, Jens Axboe wrote:
> On 5/9/20 2:46 AM, Pavel Begunkov wrote:
>> When len=0, splice() and tee() return 0 even if specified fds are
>> invalid, hiding errors from users. Move len=0 optimisation later after
>> basic validity checks.
>>
>> before:
>> splice(len=0, fd_in=-1, ...) == 0;
>>
>> after:
>> splice(len=0, fd_in=-1, ...) == -EBADF;
>
> I'm not sure what the purpose of this would be. It probably should have
> been done that way from the beginning, but it wasn't. While there's
> very little risk of breaking any applications due to this change, it
> also seems like a pointless exercise at this point.
>
> So my suggestion would be to just leave it alone.

Ok

--
Pavel Begunkov