Re: [PATCH 10/12] xfs: merge xfs_buf_reverify into xfs_buf_read_map
Brian Foster <[email protected]>
| Newsgroups | org.kernel.vger.linux-xfs |
|---|---|
| Message-ID | <alo4mWl188yS3UWn@bfoster> |
On Wed, Jul 15, 2026 at 04:51:03PM +0200, Christoph Hellwig wrote: > xfs_buf_read_map is the only caller of xfs_buf_reverify that is left. > Merge it into that so that the comments can be moved closer to the > logic, and redundant asserts can be removed. > > Signed-off-by: Christoph Hellwig <[email protected]> > --- > fs/xfs/xfs_buf.c | 79 ++++++++++++++++++++++-------------------------- > 1 file changed, 36 insertions(+), 43 deletions(-) > > diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c > index 21c21491d72e..be3b25ccbea6 100644 > --- a/fs/xfs/xfs_buf.c > +++ b/fs/xfs/xfs_buf.c ... > @@ -685,18 +650,46 @@ xfs_buf_read_map( > > trace_xfs_buf_read(bp, flags, _RET_IP_); > > - if (!(bp->b_flags & XBF_DONE)) { > + if (bp->b_flags & XBF_DONE) { > + ASSERT(bp->b_error == 0); > + > + /* > + * If the caller passed an ops structure and the buffer doesn't > + * have ops assigned yet, set the ops and use them to verify the > + * buffer contents. > + * > + * Under normal operations, every in-core buffer is verified on > + * read I/O completion, but there are two scenarios that can > + * lead to in-core buffers without an assigned ->b_ops: > + * > + * 1) During log recovery of buffers on a V4 filesystem. > + * These buffers are purged at the end of recovery, though. > + * 2) Oonline repair intentionally reads with a NULL buffer Online