Skip to content

Commit 97611f9

Browse files
kaixuxiakxdjwong
authored andcommitted
xfs: do the ASSERT for the arguments O_{u,g,p}dqpp
If we pass in XFS_QMOPT_{U,G,P}QUOTA flags and different uid/gid/prid than them currently associated with the inode, the arguments O_{u,g,p}dqpp shouldn't be NULL, so add the ASSERT for them. Signed-off-by: Kaixu Xia <kaixuxia@tencent.com> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
1 parent 8ffa90e commit 97611f9

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

fs/xfs/xfs_qm.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1662,6 +1662,7 @@ xfs_qm_vop_dqalloc(
16621662
}
16631663

16641664
if ((flags & XFS_QMOPT_UQUOTA) && XFS_IS_UQUOTA_ON(mp)) {
1665+
ASSERT(O_udqpp);
16651666
if (!uid_eq(inode->i_uid, uid)) {
16661667
/*
16671668
* What we need is the dquot that has this uid, and
@@ -1695,6 +1696,7 @@ xfs_qm_vop_dqalloc(
16951696
}
16961697
}
16971698
if ((flags & XFS_QMOPT_GQUOTA) && XFS_IS_GQUOTA_ON(mp)) {
1699+
ASSERT(O_gdqpp);
16981700
if (!gid_eq(inode->i_gid, gid)) {
16991701
xfs_iunlock(ip, lockflags);
17001702
error = xfs_qm_dqget(mp, from_kgid(user_ns, gid),
@@ -1712,6 +1714,7 @@ xfs_qm_vop_dqalloc(
17121714
}
17131715
}
17141716
if ((flags & XFS_QMOPT_PQUOTA) && XFS_IS_PQUOTA_ON(mp)) {
1717+
ASSERT(O_pdqpp);
17151718
if (ip->i_d.di_projid != prid) {
17161719
xfs_iunlock(ip, lockflags);
17171720
error = xfs_qm_dqget(mp, prid,

0 commit comments

Comments
 (0)