diff options
| -rw-r--r-- | fs/xfs/xfs_file.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c index 2323b8b63183..f6f0e9671919 100644 --- a/fs/xfs/xfs_file.c +++ b/fs/xfs/xfs_file.c | |||
| @@ -581,6 +581,16 @@ restart: | |||
| 581 | xfs_rw_iunlock(ip, *iolock); | 581 | xfs_rw_iunlock(ip, *iolock); |
| 582 | *iolock = XFS_IOLOCK_EXCL; | 582 | *iolock = XFS_IOLOCK_EXCL; |
| 583 | xfs_rw_ilock(ip, *iolock); | 583 | xfs_rw_ilock(ip, *iolock); |
| 584 | |||
| 585 | /* | ||
| 586 | * We now have an IO submission barrier in place, but | ||
| 587 | * AIO can do EOF updates during IO completion and hence | ||
| 588 | * we now need to wait for all of them to drain. Non-AIO | ||
| 589 | * DIO will have drained before we are given the | ||
| 590 | * XFS_IOLOCK_EXCL, and so for most cases this wait is a | ||
| 591 | * no-op. | ||
| 592 | */ | ||
| 593 | inode_dio_wait(inode); | ||
| 584 | goto restart; | 594 | goto restart; |
| 585 | } | 595 | } |
| 586 | error = xfs_zero_eof(ip, *pos, i_size_read(inode)); | 596 | error = xfs_zero_eof(ip, *pos, i_size_read(inode)); |
