Commit c2368fc8 authored by Nirjhar Roy (IBM)'s avatar Nirjhar Roy (IBM) Committed by Carlos Maiolino
Browse files

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: default avatarDarrick J. Wong <djwong@kernel.org>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarNirjhar Roy (IBM) <nirjhar.roy.lists@gmail.com>
Signed-off-by: default avatarCarlos Maiolino <cem@kernel.org>
parent ac1d9770
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -1050,6 +1050,15 @@ xfs_growfs_rt_bmblock(
	 */
	xfs_trans_resv_calc(mp, &mp->m_resv);

	/*
	 * Sync sb counters now to reflect the updated values. Lazy counters are
	 * not always updated and in order to avoid inconsistencies between
	 * frextents and rtextents, it is better to sync the counters.
	 */

	if (xfs_has_lazysbcount(mp))
		xfs_log_sb(args.tp);

	error = xfs_trans_commit(args.tp);
	if (error)
		goto out_free;