On Thu, Jan 04, 2024 at 09:35:28PM -0800, Christoph Hellwig wrote: > > + bp = xfs_trans_getsb(sc->tp); > > + xfs_sb_to_disk(bp->b_addr, &mp->m_sb); > > + xfs_trans_buf_set_type(sc->tp, bp, XFS_BLFT_SB_BUF); > > + xfs_trans_log_buf(sc->tp, bp, 0, sizeof(struct xfs_dsb) - 1); > > We now have a multiple copies of this code sequence and it would probably > be good to have a helper for it. Given that the current xfs_log_sb > is a bit misnamed I'd be alsmost tempted to use the name just for > this and split the lazy counter updates into a separate helper. Since we're really only updating feature flags, how about these three lines become a new xfs_trans_log_sb_featureset() helper? That's not a totally precise name since we're logging everything /except/ the lazysbcount fields though. > That also makes it very clear that we'd need to explicitly opt into > syncing them and prvent accidental bugs like this one. But I'd also > be fine with another name instead of duplicating it here and in the > pending imeta code. If we go ahead with your suggestion not to update the superblock under the hood in the xfs_imeta.[ch] for !metadir filesystems then there won't be a third caller. --D