On Wed, Jun 22, 2016 at 04:58:05PM +0000, Trond Myklebust wrote: > > For the AIO case that's not true, we can't hold i_rwsem until > > aio completes. So for something that does block allocations we'll > > need something like i_dio_count still. This probably includes the > > block / scsi layout code. > > Why can?t we hold the i_rwsem until aio completes? Because Linux rw_semaphores require have owner semantics, and require the owner that acquired them to release them again. If we have an AIO request we're not going to complete the request in the calling context, though. The same is true for regular mutexes, that's why we drop the inode lock at the end of nfs_file_direct_read/write even if I/O might still be pending. -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html