Skip to content

Commit c2368fc

Browse files
Nirjhar-Roy-0211cmaiolino
authored andcommitted
xfs: Update lazy counters in xfs_growfs_rt_bmblock()
Update lazy counters in xfs_growfs_rt_bmblock() similar to the way it is done xfs_growfs_data_private(). This is because the lazy counters are not always updated and synching the counters will avoid inconsistencies between frexents and rtextents(total realtime extent count). This will be more useful once realtime shrink is implemented as this will prevent some transient state to occur where frexents might be greater than total rtextents. Reviewed-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Nirjhar Roy (IBM) <nirjhar.roy.lists@gmail.com> Signed-off-by: Carlos Maiolino <cem@kernel.org>
1 parent ac1d977 commit c2368fc

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

fs/xfs/xfs_rtalloc.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1050,6 +1050,15 @@ xfs_growfs_rt_bmblock(
10501050
*/
10511051
xfs_trans_resv_calc(mp, &mp->m_resv);
10521052

1053+
/*
1054+
* Sync sb counters now to reflect the updated values. Lazy counters are
1055+
* not always updated and in order to avoid inconsistencies between
1056+
* frextents and rtextents, it is better to sync the counters.
1057+
*/
1058+
1059+
if (xfs_has_lazysbcount(mp))
1060+
xfs_log_sb(args.tp);
1061+
10531062
error = xfs_trans_commit(args.tp);
10541063
if (error)
10551064
goto out_free;

0 commit comments

Comments
 (0)