From: Ben Myers <bpm@sgi.com>
To: Chandra Seetharaman <sekharan@us.ibm.com>
Cc: xfs@oss.sgi.com
Subject: Re: [RFC v5 PATCH 2/4] xfs: Add pquota fields where gquota is used.
Date: Fri, 4 May 2012 15:04:03 -0500 [thread overview]
Message-ID: <20120504200403.GW16881@sgi.com> (raw)
In-Reply-To: <20120314202636.17044.11836.sendpatchset@chandra-lucid.austin.ibm.com>
On Wed, Mar 14, 2012 at 03:26:36PM -0500, Chandra Seetharaman wrote:
> @@ -1517,7 +1521,7 @@ xfs_symlink(
> int n;
> xfs_buf_t *bp;
> prid_t prid;
> - struct xfs_dquot *udqp, *gdqp;
> + struct xfs_dquot *udqp, *gdqp, *pdqp;
> uint resblks;
>
> *ipp = NULL;
> @@ -1547,7 +1551,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;
>
> @@ -1588,7 +1592,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;
>
> @@ -1626,7 +1631,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);
> @@ -1710,6 +1715,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;
> @@ -1723,6 +1729,7 @@ xfs_symlink(
> xfs_trans_cancel(tp, cancel_flags);
> xfs_qm_dqrele(udqp);
> xfs_qm_dqrele(gdqp);
> + xfs_qm_dqrele(pdqp);
^^^^
Crashing here consistently on test 005, null ptr deref.
pdqp needs to be initialized in this function:
Index: xfs/fs/xfs/xfs_vnodeops.c
===================================================================
--- xfs.orig/fs/xfs/xfs_vnodeops.c
+++ xfs/fs/xfs/xfs_vnodeops.c
@@ -1525,7 +1525,7 @@ xfs_symlink(
if (pathlen >= MAXPATHLEN) /* total string too long */
return XFS_ERROR(ENAMETOOLONG);
- udqp = gdqp = NULL;
+ udqp = gdqp = pdqp = NULL;
if (dp->i_d.di_flags & XFS_DIFLAG_PROJINHERIT)
prid = xfs_get_projid(dp);
else
-Ben
>
> if (unlock_dp_on_error)
> xfs_iunlock(dp, XFS_ILOCK_EXCL);
> @@ -2189,7 +2196,7 @@ xfs_free_file_space(
> }
> xfs_ilock(ip, XFS_ILOCK_EXCL);
> error = xfs_trans_reserve_quota(tp, mp,
> - ip->i_udquot, ip->i_gdquot,
> + ip->i_udquot, ip->i_gdquot, ip->i_pdquot,
> resblks, 0, XFS_QMOPT_RES_REGBLKS);
> if (error)
> goto error1;
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2012-05-04 20:00 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-14 20:26 [RFC v5 PATCH 0/4] xfs: Allow pquota and gquota to be used together Chandra Seetharaman
2012-03-14 20:26 ` [RFC v5 PATCH 1/4] xfs: Remove incore use of XFS_OQUOTA_ENFD and XFS_OQUOTA_CHKD Chandra Seetharaman
2012-03-14 20:26 ` [RFC v5 PATCH 2/4] xfs: Add pquota fields where gquota is used Chandra Seetharaman
2012-05-02 20:49 ` Ben Myers
2012-05-02 22:51 ` Chandra Seetharaman
2012-06-19 7:25 ` Christoph Hellwig
2012-05-04 20:00 ` Ben Myers
2012-05-04 20:04 ` Ben Myers [this message]
2012-03-14 20:26 ` [RFC v5 PATCH 3/4] xfs: Add pquotaino to on-disk super block Chandra Seetharaman
2012-05-03 17:16 ` Ben Myers
2012-05-03 20:16 ` Chandra Seetharaman
2012-05-04 19:52 ` Ben Myers
2012-03-14 20:26 ` [RFC v5 PATCH 4/4] xfs: Add a new field to fs_quota_stat to get pquota information Chandra Seetharaman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120504200403.GW16881@sgi.com \
--to=bpm@sgi.com \
--cc=sekharan@us.ibm.com \
--cc=xfs@oss.sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox