> + /* Don't sleep on inode rwsem */ > + if (iocb->ki_flags & IOCB_NONBLOCKING) { > + if (!inode_trylock(inode)) > + return -EAGAIN; > + } else > + inode_lock(inode); A way to avoid the additional branch in the fast path would be: if (!inode_trylock(inode)) { if (iocb->ki_flags & IOCB_NONBLOCKING) return -EAGAIN; inode_lock(inode); } but otherwise this looks fine: Reviewed-by: Christoph Hellwig <hch@xxxxxx>