xfs: reduce IOCB_NOWAIT judgment for retry exclusive unaligned DIO
PATCH 1/1 xfs: reduce IOCB_NOWAIT judgment for retry exclusive unaligned DIO
From: Kaixu Xia <[email protected]>
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 <[email protected]>
--- fs/xfs/xfs_file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/xfs/xfs_file.c +1 -1
@@ -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 ; }
Signature · 1 line
2.27.0
Quoted 8 lines · On 5/18/22 09:01, [email protected] wrote:
From: Kaixu Xia <[email protected]>
Retry unaligned DIO with exclusive blocking semantics only when the
IOCB_NOWAITflag is not set. If we are doing nonblocking user I/O, propagate the error directly.Signed-off-by Kaixu Xia <[email protected]>---
Looks good.
Reviewed-by Chaitanya Kulkarni <[email protected]>
-ck
Quoted 18 lines
fs/xfs/xfs_file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/xfs/xfs_file.c +1
-1@@ -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 ; }