Re: [PATCH v2 4/7] block: honor IOCB_NOWAIT in the block device buffered read path

From: Christoph Hellwig

Date: Mon Sep 07 2026 - 03:20:22 EST


> + if (iocb->ki_flags & IOCB_NOWAIT) {
> + if (!inode_trylock_shared(bd_inode)) {
> + if (!ret)
> + ret = -EAGAIN;
> + goto reexpand;
> + }
> + } else {
> + inode_lock_shared(bd_inode);
> + }

Looks good:

Reviewed-by: Christoph Hellwig <hch@xxxxxx>

Do we want something like kiocb_inode_lock/kiocb_inode_lock_shared helper
to better encapsulate this pattern?