* [PATCH] xfs: reduce IOCB_NOWAIT judgment for retry exclusive unaligned DIO
@ 2022-05-18 16:01 xiakaixu1987
2022-05-18 20:38 ` Chaitanya Kulkarni
0 siblings, 1 reply; 2+ messages in thread
From: xiakaixu1987 @ 2022-05-18 16:01 UTC (permalink / raw)
To: linux-xfs; +Cc: djwong, david, Kaixu Xia
From: Kaixu Xia <kaixuxia@tencent.com>
Retry unaligned DIO with exclusive blocking semantics only when the
IOCB_NOWAIT flag is not set. If we are doing nonblocking user I/O,
propagate the error directly.
Signed-off-by: Kaixu Xia <kaixuxia@tencent.com>
---
fs/xfs/xfs_file.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c
index 5bddb1e9e0b3..250a3f97400d 100644
--- a/fs/xfs/xfs_file.c
+++ b/fs/xfs/xfs_file.c
@@ -576,9 +576,9 @@ xfs_file_dio_write_unaligned(
* don't even bother trying the fast path in this case.
*/
if (iocb->ki_pos > isize || iocb->ki_pos + count >= isize) {
-retry_exclusive:
if (iocb->ki_flags & IOCB_NOWAIT)
return -EAGAIN;
+retry_exclusive:
iolock = XFS_IOLOCK_EXCL;
flags = IOMAP_DIO_FORCE_WAIT;
}
--
2.27.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] xfs: reduce IOCB_NOWAIT judgment for retry exclusive unaligned DIO
2022-05-18 16:01 [PATCH] xfs: reduce IOCB_NOWAIT judgment for retry exclusive unaligned DIO xiakaixu1987
@ 2022-05-18 20:38 ` Chaitanya Kulkarni
0 siblings, 0 replies; 2+ messages in thread
From: Chaitanya Kulkarni @ 2022-05-18 20:38 UTC (permalink / raw)
To: xiakaixu1987@gmail.com, linux-xfs@vger.kernel.org
Cc: djwong@kernel.org, david@fromorbit.com, Kaixu Xia
On 5/18/22 09:01, xiakaixu1987@gmail.com wrote:
> From: Kaixu Xia <kaixuxia@tencent.com>
>
> Retry unaligned DIO with exclusive blocking semantics only when the
> IOCB_NOWAIT flag is not set. If we are doing nonblocking user I/O,
> propagate the error directly.
>
> Signed-off-by: Kaixu Xia <kaixuxia@tencent.com>
> ---
Looks good.
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
-ck
> fs/xfs/xfs_file.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c
> index 5bddb1e9e0b3..250a3f97400d 100644
> --- a/fs/xfs/xfs_file.c
> +++ b/fs/xfs/xfs_file.c
> @@ -576,9 +576,9 @@ xfs_file_dio_write_unaligned(
> * don't even bother trying the fast path in this case.
> */
> if (iocb->ki_pos > isize || iocb->ki_pos + count >= isize) {
> -retry_exclusive:
> if (iocb->ki_flags & IOCB_NOWAIT)
> return -EAGAIN;
> +retry_exclusive:
> iolock = XFS_IOLOCK_EXCL;
> flags = IOMAP_DIO_FORCE_WAIT;
> }
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-05-18 20:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-05-18 16:01 [PATCH] xfs: reduce IOCB_NOWAIT judgment for retry exclusive unaligned DIO xiakaixu1987
2022-05-18 20:38 ` Chaitanya Kulkarni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).