On Tue, Aug 18, 2020 at 04:02:56PM -0700, Darrick J. Wong wrote: > > - xfs_buf_flags_t flags) > > + struct xfs_buf *bp, > > + xfs_buf_flags_t flags, > > + const struct xfs_buf_ops *ops) > > { > > - ASSERT(!(flags & XBF_WRITE)); > > ASSERT(bp->b_maps[0].bm_bn != XFS_BUF_DADDR_NULL); > > + ASSERT(!(flags & XBF_WRITE)); > > > > - bp->b_flags &= ~(XBF_WRITE | XBF_ASYNC | XBF_READ_AHEAD); > > - bp->b_flags |= flags & (XBF_READ | XBF_ASYNC | XBF_READ_AHEAD); > > + bp->b_flags &= ~(XBF_WRITE | XBF_ASYNC | XBF_READ_AHEAD | XBF_DONE); > > + bp->b_flags |= flags & (XBF_ASYNC | XBF_READ_AHEAD); > > Doesn't this change mean that the caller's XBF_READ never gets set > in bp->b_flags? If the buffer is already in memory but doesn't have > XBF_DONE set, how does XBF_READ get set? Maybe I'm missing something? Yes, this is broken for the re-read case.