Skip to content

Commit

Permalink
[XFS] Flush and invalidate dirty pages at the start of a direct read …
Browse files Browse the repository at this point in the history
…also,

else we can hit a delalloc-extents-via-direct-io BUG.

SGI-PV: 949916
SGI-Modid: xfs-linux-melb:xfs-kern:25483a

Signed-off-by: Nathan Scott <nathans@sgi.com>
  • Loading branch information
Nathan Scott committed Mar 17, 2006
1 parent ce9d37c commit 9cea236
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions fs/xfs/linux-2.6/xfs_lrw.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,10 @@ xfs_read(
}
}

if (unlikely((ioflags & IO_ISDIRECT) && VN_CACHED(vp)))
VOP_FLUSHINVAL_PAGES(vp, ctooff(offtoct(*offset)),
-1, FI_REMAPF_LOCKED);

xfs_rw_enter_trace(XFS_READ_ENTER, &ip->i_iocore,
(void *)iovp, segs, *offset, ioflags);
ret = __generic_file_aio_read(iocb, iovp, segs, offset);
Expand Down

0 comments on commit 9cea236

Please sign in to comment.