[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20191023065111.027304C040@d06av22.portsmouth.uk.ibm.com>
Date: Wed, 23 Oct 2019 12:21:10 +0530
From: Ritesh Harjani <riteshh@...ux.ibm.com>
To: Matthew Bobrowski <mbobrowski@...browski.org>, tytso@....edu,
jack@...e.cz, adilger.kernel@...ger.ca
Cc: linux-ext4@...r.kernel.org, linux-fsdevel@...r.kernel.org,
hch@...radead.org, david@...morbit.com, darrick.wong@...cle.com
Subject: Re: [PATCH v5 08/12] ext4: update direct I/O read to do trylock in
IOCB_NOWAIT cases
On 10/21/19 2:48 PM, Matthew Bobrowski wrote:
> This patch updates the lock pattern in ext4_dio_read_iter() to only
> perform the trylock in IOCB_NOWAIT cases.
>
> Signed-off-by: Matthew Bobrowski <mbobrowski@...browski.org>
This shall need a rebase (as mentioned in patch-1 discussion).
It will be good to mention that the locking condition
is kept similar to 942491c9e6d6 ("xfs: fix AIM7 regression").
Also, I think it may also need a fixes tag.
It seems unconditional inode_lock_shared was added by below commit.
Fixes: 16c54688592c ("ext4: Allow parallel DIO reads")
Otherwise, this patch looks good to me. You may add:
Reviewed-by: Ritesh Harjani <riteshh@...ux.ibm.com>
> ---
> fs/ext4/file.c | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/fs/ext4/file.c b/fs/ext4/file.c
> index 6ea7e00e0204..8420686b90f5 100644
> --- a/fs/ext4/file.c
> +++ b/fs/ext4/file.c
> @@ -52,7 +52,13 @@ static int ext4_dio_read_iter(struct kiocb *iocb, struct iov_iter *to)
> ssize_t ret;
> struct inode *inode = file_inode(iocb->ki_filp);
>
> - inode_lock_shared(inode);
> + if (iocb->ki_flags & IOCB_NOWAIT) {
> + if (!inode_trylock_shared(inode))
> + return -EAGAIN;
> + } else {
> + inode_lock_shared(inode);
> + }
> +
> if (!ext4_dio_supported(inode)) {
> inode_unlock_shared(inode);
> /*
>
Powered by blists - more mailing lists