浏览代码

[XFS] Flush and invalidate dirty pages at the start of a direct read 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>

Nathan Scott 19 年之前
父节点
当前提交
9cea236492
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      fs/xfs/linux-2.6/xfs_lrw.c

+ 4 - 0
fs/xfs/linux-2.6/xfs_lrw.c

@@ -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);