Bob, On Wed, 1 May 2019 at 01:03, Bob Peterson <rpete...@redhat.com> wrote: > This patch adds some instrumentation in gfs2's journal replay that > indicates when we're about to overwrite a rgrp for which we already > have a valid buffer_head.
looks okay, but can you explain in the commit message when this problem will trigger and why that's a problem? Thanks, Andreas > Signed-off-by: Bob Peterson <rpete...@redhat.com> > --- > fs/gfs2/lops.c | 22 ++++++++++++++++++++-- > 1 file changed, 20 insertions(+), 2 deletions(-) > > diff --git a/fs/gfs2/lops.c b/fs/gfs2/lops.c > index 6af6a3cea967..2e8c6d02e112 100644 > --- a/fs/gfs2/lops.c > +++ b/fs/gfs2/lops.c > @@ -564,9 +564,27 @@ static int buf_lo_scan_elements(struct gfs2_jdesc *jd, > u32 start, > > if (gfs2_meta_check(sdp, bh_ip)) > error = -EIO; > - else > + else { > + struct gfs2_meta_header *mh = > + (struct gfs2_meta_header *)bh_ip->b_data; > + > + if (mh->mh_type == cpu_to_be32(GFS2_METATYPE_RG)) { > + struct gfs2_rgrpd *rgd; > + > + rgd = gfs2_blk2rgrpd(sdp, blkno, false); > + if (rgd && rgd->rd_addr == blkno && > + rgd->rd_bits && rgd->rd_bits->bi_bh) { > + fs_info(sdp, "Replaying 0x%llx but we > " > + "already have a bh!\n", > + (unsigned long long)blkno); > + fs_info(sdp, "busy:%d, pinned:%d\n", > + > buffer_busy(rgd->rd_bits->bi_bh) ? 1 : 0, > + > buffer_pinned(rgd->rd_bits->bi_bh)); > + gfs2_dump_glock(NULL, rgd->rd_gl); > + } > + } > mark_buffer_dirty(bh_ip); > - > + } > brelse(bh_log); > brelse(bh_ip); > > -- > 2.20.1 >