io_cancel return value change

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

 



Hi, Kent,

Sorry to bring this up long after your patches have gone in--I am
remiss.  In the following commit, you changed what was returned by the
io_cancel system call:

commit bec68faaf3ba74ed0dcd5dc3a881b30aec542973
Author: Kent Overstreet <koverstreet@xxxxxxxxxx>
Date:   Mon May 13 14:45:08 2013 -0700

    aio: io_cancel() no longer returns the io_event
    
    Originally, io_event() was documented to return the io_event if
    cancellation succeeded - the io_event wouldn't be delivered via the ring
    buffer like it normally would.
    
    But this isn't what the implementation was actually doing; the only
    driver implementing cancellation, the usb gadget code, never returned an
    io_event in its cancel function. And aio_complete() was recently changed
    to no longer suppress event delivery if the kiocb had been cancelled.
    
    This gets rid of the unused io_event argument to kiocb_cancel() and
    kiocb->ki_cancel(), and changes io_cancel() to return -EINPROGRESS if
    kiocb->ki_cancel() returned success.
    
    Also tweak the refcounting in kiocb_cancel() to make more sense.

You made a passing reference to previous aio_complete changes as well
that I can't easily track down (it wasn't mentioned in the commit log
that I can tell, and it isn't obvious to me by looking through the patch
set).

At the very least, you need to also include man page updates for this.
Honestly, though, we should not have let this patch set go in as is.  If
any software actually wrote code to handle cancellation, this change
would surely cause confusion.  That said, I think you got away with this
for two reasons:
1) no drivers implements a cancellation routine (except the crazy usb
   gadgetfs thing)
2) userspace code may not even call io_cancel (who knows?), and if they
   do, well, see point 1.

My preference would be for this behavior change to be reverted.  You
could make a case for keeping the change and updating the
documentation.  I'm not convinced 100% one way or the other.  So what do
you (and others) think?

Cheers,
Jeff

p.s. I did do a quick google search, and the only caller of io_cancel I
could find was a test harness.  But, that's certainly not proof that
nobody does it!
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




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