diff options
author | Darrick J. Wong <darrick.wong@oracle.com> | 2018-06-12 00:52:01 -0400 |
---|---|---|
committer | Darrick J. Wong <darrick.wong@oracle.com> | 2018-06-12 00:53:52 -0400 |
commit | 89e9b5c0915aaeaf673a14e794c559768eda5534 (patch) | |
tree | 192f047e8d72bf02127c944d6b9f47c8b930e3f0 | |
parent | 0703a8e1c17e2cba742eafe640be3b60f77352c4 (diff) |
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: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
-rw-r--r-- | fs/xfs/libxfs/xfs_ialloc.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/xfs/libxfs/xfs_ialloc.c b/fs/xfs/libxfs/xfs_ialloc.c index 8ec39dad62d7..0d968e8143aa 100644 --- a/fs/xfs/libxfs/xfs_ialloc.c +++ b/fs/xfs/libxfs/xfs_ialloc.c | |||
@@ -897,6 +897,7 @@ sparse_alloc: | |||
897 | be32_add_cpu(&agi->agi_freecount, newlen); | 897 | be32_add_cpu(&agi->agi_freecount, newlen); |
898 | pag = xfs_perag_get(args.mp, agno); | 898 | pag = xfs_perag_get(args.mp, agno); |
899 | pag->pagi_freecount += newlen; | 899 | pag->pagi_freecount += newlen; |
900 | pag->pagi_count += newlen; | ||
900 | xfs_perag_put(pag); | 901 | xfs_perag_put(pag); |
901 | agi->agi_newino = cpu_to_be32(newino); | 902 | agi->agi_newino = cpu_to_be32(newino); |
902 | 903 | ||
@@ -1991,6 +1992,7 @@ xfs_difree_inobt( | |||
1991 | xfs_ialloc_log_agi(tp, agbp, XFS_AGI_COUNT | XFS_AGI_FREECOUNT); | 1992 | xfs_ialloc_log_agi(tp, agbp, XFS_AGI_COUNT | XFS_AGI_FREECOUNT); |
1992 | pag = xfs_perag_get(mp, agno); | 1993 | pag = xfs_perag_get(mp, agno); |
1993 | pag->pagi_freecount -= ilen - 1; | 1994 | pag->pagi_freecount -= ilen - 1; |
1995 | pag->pagi_count -= ilen; | ||
1994 | xfs_perag_put(pag); | 1996 | xfs_perag_put(pag); |
1995 | xfs_trans_mod_sb(tp, XFS_TRANS_SB_ICOUNT, -ilen); | 1997 | xfs_trans_mod_sb(tp, XFS_TRANS_SB_ICOUNT, -ilen); |
1996 | xfs_trans_mod_sb(tp, XFS_TRANS_SB_IFREE, -(ilen - 1)); | 1998 | xfs_trans_mod_sb(tp, XFS_TRANS_SB_IFREE, -(ilen - 1)); |