mirror of
https://github.com/torvalds/linux.git
synced 2026-05-27 00:22:00 +02:00
xfs: improve the xg_active_ref check in xfs_group_free
Split up the XFS_IS_CORRUPT statement so that it immediately shows if the reference counter overflowed or underflowed. I ran into this quite a bit when developing the zoned allocator, and had to reapply the patch for some work recently. We might as well just apply it upstream given that freeing group is far removed from performance critical code. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Darrick J. Wong <djwong@kernel.org> Signed-off-by: Carlos Maiolino <cem@kernel.org>
This commit is contained in:
parent
ff67c13dc8
commit
59655147ec
|
|
@ -172,7 +172,8 @@ xfs_group_free(
|
|||
|
||||
/* drop the mount's active reference */
|
||||
xfs_group_rele(xg);
|
||||
XFS_IS_CORRUPT(mp, atomic_read(&xg->xg_active_ref) != 0);
|
||||
XFS_IS_CORRUPT(mp, atomic_read(&xg->xg_active_ref) > 0);
|
||||
XFS_IS_CORRUPT(mp, atomic_read(&xg->xg_active_ref) < 0);
|
||||
kfree_rcu_mightsleep(xg);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user