Skip to content

Commit 93e6aa4

Browse files
kaixuxiakxdchinner
authored andcommitted
xfs: reduce IOCB_NOWAIT judgment for retry exclusive unaligned DIO
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]> Reviewed-by: Chaitanya Kulkarni <[email protected]> Reviewed-by: Dave Chinner <[email protected]> Signed-off-by: Dave Chinner <[email protected]>
1 parent e62c720 commit 93e6aa4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/xfs/xfs_file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -576,9 +576,9 @@ xfs_file_dio_write_unaligned(
576576
* don't even bother trying the fast path in this case.
577577
*/
578578
if (iocb->ki_pos > isize || iocb->ki_pos + count >= isize) {
579-
retry_exclusive:
580579
if (iocb->ki_flags & IOCB_NOWAIT)
581580
return -EAGAIN;
581+
retry_exclusive:
582582
iolock = XFS_IOLOCK_EXCL;
583583
flags = IOMAP_DIO_FORCE_WAIT;
584584
}

0 commit comments

Comments
 (0)