On Mon, Feb 01, 2021 at 12:18:34PM +0000, Christoph Hellwig wrote: > > > > if (XFS_IS_UQUOTA_ON(mp) && udqp && > > i_uid_read(VFS_I(ip)) != udqp->q_id) > > - udq_delblks = udqp; > > + new_udqp = udqp; > > We don't even need two variables for each type, instead we can just > clear the original pointer to NULL if the conditions aren't met. Once I've made xfs_trans_alloc_ichange the only caller of xfs_trans_reserve_quota_chown, I think we could get rid of these checks entirely, since there ought to be a 1:1 correspondence between (i_udquot == new_udqp) and (i_uid_read(VFS_I(ip)) == new_udqp->q_id), if the caller even passed in a new_udqp. Though... if I take your (later) suggestion to move the call to xfs_trans_reserve_quota_bydquots into xfs_trans_alloc_ichange, then it makes more sense to drop all these patches. --D