From 689e11c84b15866619e7582486acacaf79d7e3e2 Mon Sep 17 00:00:00 2001 From: "Darrick J. Wong" Date: Mon, 14 May 2018 06:34:31 -0700 Subject: xfs: superblock scrub should use short-lived buffers Secondary superblocks are rarely used, so create a helper to read a given non-primary AG's superblock and ensure that it won't stick around hogging memory. Signed-off-by: Darrick J. Wong Reviewed-by: Brian Foster --- fs/xfs/scrub/agheader.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'fs/xfs/scrub/agheader.c') diff --git a/fs/xfs/scrub/agheader.c b/fs/xfs/scrub/agheader.c index 08a1f013d92c..831acc0a328f 100644 --- a/fs/xfs/scrub/agheader.c +++ b/fs/xfs/scrub/agheader.c @@ -157,9 +157,7 @@ xfs_scrub_superblock( if (agno == 0) return 0; - error = xfs_trans_read_buf(mp, sc->tp, mp->m_ddev_targp, - XFS_AGB_TO_DADDR(mp, agno, XFS_SB_BLOCK(mp)), - XFS_FSS_TO_BB(mp, 1), 0, &bp, &xfs_sb_buf_ops); + error = xfs_sb_read_secondary(mp, sc->tp, agno, &bp); /* * The superblock verifier can return several different error codes * if it thinks the superblock doesn't look right. For a mount these -- cgit v1.2.3