Re: [PATCH] fs: kill unused ret2 argument from iocb->ki_complete()

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

 



On 10/20/21 12:16 PM, Jeff Moyer wrote:
> Hi, Jens,
> 
> Jens Axboe <axboe@xxxxxxxxx> writes:
> 
>> It's not used for anything, and we're wasting time passing in zeroes
>> where we could just ignore it instead. Update all ki_complete users in
>> the kernel to drop that last argument.
> 
> What does "wasting time passing in zeroes" mean?

That everybody but the funky usb gadget code passes in zero, hence it's
a waste of time to pass it in as an argument.

>> The exception is the USB gadget code, which passes in non-zero. But
>> since nobody every looks at ret2, it's still pointless.
> 
> As Christoph mentioned, it is passed along to userspace as part of the
> io_event.

Right

>> @@ -499,8 +499,7 @@ static void ep_aio_complete(struct usb_ep *ep, struct usb_request *req)
>>  		/* aio_complete() reports bytes-transferred _and_ faults */
> 
> Note this comment ^^^
> 
>>  
>>  		iocb->ki_complete(iocb,
>> -				req->actual ? req->actual : (long)req->status,
>> -				req->status);
>> +				req->actual ? req->actual : (long)req->status);
> 
> We can't know whether some userspace implementation relies on this
> behavior, so I don't think you can change it.

Well, I think we should find out, particularly as it's the sole user of
that extra argument. No generic aio code would look at res2, exactly
because it is always zero for anything but some weird usb gadget code.

-- 
Jens Axboe




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux