Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 89e9b5c0 authored by Darrick J. Wong's avatar Darrick J. Wong
Browse files

xfs: update incore per-AG inode count



For whatever reason we never actually update pagi_count (the in-core
perag inode count) when we allocate or free inode chunks.  Online scrub
is going to use it, so we need to fix the accounting.

Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: default avatarBrian Foster <bfoster@redhat.com>
parent 0703a8e1
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -897,6 +897,7 @@ xfs_ialloc_ag_alloc(
	be32_add_cpu(&agi->agi_freecount, newlen);
	pag = xfs_perag_get(args.mp, agno);
	pag->pagi_freecount += newlen;
	pag->pagi_count += newlen;
	xfs_perag_put(pag);
	agi->agi_newino = cpu_to_be32(newino);

@@ -1991,6 +1992,7 @@ xfs_difree_inobt(
		xfs_ialloc_log_agi(tp, agbp, XFS_AGI_COUNT | XFS_AGI_FREECOUNT);
		pag = xfs_perag_get(mp, agno);
		pag->pagi_freecount -= ilen - 1;
		pag->pagi_count -= ilen;
		xfs_perag_put(pag);
		xfs_trans_mod_sb(tp, XFS_TRANS_SB_ICOUNT, -ilen);
		xfs_trans_mod_sb(tp, XFS_TRANS_SB_IFREE, -(ilen - 1));