]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: update incore per-AG inode count
authorDarrick J. Wong <darrick.wong@oracle.com>
Thu, 28 Jun 2018 20:11:59 +0000 (15:11 -0500)
committerEric Sandeen <sandeen@redhat.com>
Thu, 28 Jun 2018 20:11:59 +0000 (15:11 -0500)
Source kernel commit: 89e9b5c0915aaeaf673a14e794c559768eda5534

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: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
libxfs/xfs_ialloc.c

index dd19e97083e47646561bc8f40ed8f83337447bf6..91d00e263fc4e9899f6c39f56765e97e6317f950 100644 (file)
@@ -891,6 +891,7 @@ sparse_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);
 
@@ -1985,6 +1986,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));