]> Pileus Git - ~andy/linux/blobdiff - fs/xfs/xfs_symlink.c
arm64: perf: fix array out of bounds access in armpmu_map_hw_event()
[~andy/linux] / fs / xfs / xfs_symlink.c
index e830fb56e27f9fa0a979dee9f3f58b56e6afa6ae..f4895b662fcb549706881a4dd65a8b048d23d03e 100644 (file)
@@ -360,6 +360,7 @@ xfs_symlink(
        prid_t                  prid;
        struct xfs_dquot        *udqp = NULL;
        struct xfs_dquot        *gdqp = NULL;
+       struct xfs_dquot        *pdqp = NULL;
        uint                    resblks;
 
        *ipp = NULL;
@@ -386,7 +387,7 @@ xfs_symlink(
         * Make sure that we have allocated dquot(s) on disk.
         */
        error = xfs_qm_vop_dqalloc(dp, current_fsuid(), current_fsgid(), prid,
-                       XFS_QMOPT_QUOTALL | XFS_QMOPT_INHERIT, &udqp, &gdqp);
+               XFS_QMOPT_QUOTALL | XFS_QMOPT_INHERIT, &udqp, &gdqp, &pdqp);
        if (error)
                goto std_return;
 
@@ -427,7 +428,8 @@ xfs_symlink(
        /*
         * Reserve disk quota : blocks and inode.
         */
-       error = xfs_trans_reserve_quota(tp, mp, udqp, gdqp, resblks, 1, 0);
+       error = xfs_trans_reserve_quota(tp, mp, udqp, gdqp,
+                                               pdqp, resblks, 1, 0);
        if (error)
                goto error_return;
 
@@ -465,7 +467,7 @@ xfs_symlink(
        /*
         * Also attach the dquot(s) to it, if applicable.
         */
-       xfs_qm_vop_create_dqattach(tp, ip, udqp, gdqp);
+       xfs_qm_vop_create_dqattach(tp, ip, udqp, gdqp, pdqp);
 
        if (resblks)
                resblks -= XFS_IALLOC_SPACE_RES(mp);
@@ -563,6 +565,7 @@ xfs_symlink(
        error = xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES);
        xfs_qm_dqrele(udqp);
        xfs_qm_dqrele(gdqp);
+       xfs_qm_dqrele(pdqp);
 
        *ipp = ip;
        return 0;
@@ -576,6 +579,7 @@ xfs_symlink(
        xfs_trans_cancel(tp, cancel_flags);
        xfs_qm_dqrele(udqp);
        xfs_qm_dqrele(gdqp);
+       xfs_qm_dqrele(pdqp);
 
        if (unlock_dp_on_error)
                xfs_iunlock(dp, XFS_ILOCK_EXCL);