On Mon, 5 Aug 2019, Jeff Layton wrote: > xfstest generic/451 intermittently fails. The test does O_DIRECT writes > to a file, and then reads back the result using buffered I/O, while > running a separate set of tasks that are also doing buffered reads. > > The client will invalidate the cache prior to a direct write, but it's > easy for one of the other readers' replies to race in and reinstantiate > the invalidated range with stale data. Maybe a silly question, but: what if the write path did the invalidation after the write instead of before? Then any racing read will see the new data on disk. sage