This series adds nonblocking feature to asynchronous I/O writes. io_submit() can be delayed because of a number of reason: - Block allocation for files - Data writebacks for direct I/O - Sleeping because of waiting to acquire i_rwsem - Congested block device The goal of the patch series is to return -EAGAIN/-EWOULDBLOCK if any of these conditions are met. This way userspace can push most of the write()s to the kernel to the best of its ability to complete and if it returns -EAGAIN, can defer it to another thread. In order to enable this, IOCB_FLAG_NONBLOCKING is introduced in uapi/linux/aio_abi.h which translates to IOCB_BLOCKING for struct iocb. This feature is provided for direct I/O of asynchronous I/O only. I have tested it against xfs, ext4, and btrfs. -- Goldwyn