Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 23158
b: refs/heads/master
c: 38e2299
h: refs/heads/master
v: v3
  • Loading branch information
David Chinner authored and Nathan Scott committed Mar 22, 2006
1 parent b1392a9 commit 2beb6f5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9fa8046f50bcb88ab9183ee1f22de5adc42bf92a
refs/heads/master: 38e2299a641d93d029eb559e096648ab75a22be2
10 changes: 10 additions & 0 deletions trunk/fs/xfs/xfs_inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1393,6 +1393,16 @@ xfs_itrunc_trace(
* calling into the buffer/page cache code and we can't hold the
* inode lock when we do so.
*
* We need to wait for any direct I/Os in flight to complete before we
* proceed with the truncate. This is needed to prevent the extents
* being read or written by the direct I/Os from being removed while the
* I/O is in flight as there is no other method of synchronising
* direct I/O with the truncate operation. Also, because we hold
* the IOLOCK in exclusive mode, we prevent new direct I/Os from being
* started until the truncate completes and drops the lock. Essentially,
* the vn_iowait() call forms an I/O barrier that provides strict ordering
* between direct I/Os and the truncate operation.
*
* The flags parameter can have either the value XFS_ITRUNC_DEFINITE
* or XFS_ITRUNC_MAYBE. The XFS_ITRUNC_MAYBE value should be used
* in the case that the caller is locking things out of order and
Expand Down

0 comments on commit 2beb6f5

Please sign in to comment.