From: Ben Myers <bpm@sgi.com>
To: Chandra Seetharaman <sekharan@us.ibm.com>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH v10 08/11] xfs: Add pquota fields where gquota is used.
Date: Wed, 10 Jul 2013 16:39:07 -0500 [thread overview]
Message-ID: <20130710213907.GZ20932@sgi.com> (raw)
In-Reply-To: <1372371914-11370-9-git-send-email-sekharan@us.ibm.com>
Hi Chandra,
On Thu, Jun 27, 2013 at 05:25:11PM -0500, Chandra Seetharaman wrote:
> Add project quota changes to all the places where group quota field
> is used:
> * add separate project quota members into various structures
> * split project quota and group quotas so that instead of overriding
> the group quota members incore, the new project quota members are
> used instead
> * get rid of usage of the OQUOTA flag incore, in favor of separate
> * group and project quota flags.
^ * is extra?
> * add a project dquot argument to various functions.
>
> Not using the pquotino field from superblock yet.
>
> Signed-off-by: Chandra Seetharaman <sekharan@us.ibm.com>
Patch looks good to me.
Reviewed-by: Ben Myers <bpm@sgi.com>
I had just a few tiny nits and questions I found in review. If you were not
already planning to repost I suggest you ignore them. ;)
Regards,
Ben
> diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c
> index 5e99968..71a8bc5 100644
> --- a/fs/xfs/xfs_ioctl.c
> +++ b/fs/xfs/xfs_ioctl.c
> @@ -928,7 +928,7 @@ xfs_ioctl_setattr(
> struct xfs_trans *tp;
> unsigned int lock_flags = 0;
> struct xfs_dquot *udqp = NULL;
> - struct xfs_dquot *gdqp = NULL;
> + struct xfs_dquot *pdqp = NULL;
> struct xfs_dquot *olddquot = NULL;
> int code;
>
> @@ -957,7 +957,7 @@ xfs_ioctl_setattr(
> if (XFS_IS_QUOTA_ON(mp) && (mask & FSX_PROJID)) {
> code = xfs_qm_vop_dqalloc(ip, ip->i_d.di_uid,
> ip->i_d.di_gid, fa->fsx_projid,
> - XFS_QMOPT_PQUOTA, &udqp, &gdqp);
> + XFS_QMOPT_PQUOTA, &udqp, NULL, &pdqp);
> if (code)
> return code;
> }
> @@ -994,8 +994,8 @@ xfs_ioctl_setattr(
> XFS_IS_PQUOTA_ON(mp) &&
> xfs_get_projid(ip) != fa->fsx_projid) {
> ASSERT(tp);
> - code = xfs_qm_vop_chown_reserve(tp, ip, udqp, gdqp,
> - capable(CAP_FOWNER) ?
> + code = xfs_qm_vop_chown_reserve(tp, ip, udqp, NULL,
> + pdqp, capable(CAP_FOWNER) ?
> XFS_QMOPT_FORCE_RES : 0);
> if (code) /* out of quota */
> goto error_return;
> @@ -1113,7 +1113,7 @@ xfs_ioctl_setattr(
> if (xfs_get_projid(ip) != fa->fsx_projid) {
> if (XFS_IS_QUOTA_RUNNING(mp) && XFS_IS_PQUOTA_ON(mp)) {
> olddquot = xfs_qm_vop_chown(tp, ip,
> - &ip->i_gdquot, gdqp);
> + &ip->i_pdquot, pdqp);
> }
> xfs_set_projid(ip, fa->fsx_projid);
>
> @@ -1160,13 +1160,13 @@ xfs_ioctl_setattr(
> */
> xfs_qm_dqrele(olddquot);
> xfs_qm_dqrele(udqp);
> - xfs_qm_dqrele(gdqp);
> + xfs_qm_dqrele(pdqp);
>
> return code;
>
> error_return:
> xfs_qm_dqrele(udqp);
> - xfs_qm_dqrele(gdqp);
> + xfs_qm_dqrele(pdqp);
> xfs_trans_cancel(tp, 0);
> if (lock_flags)
> xfs_iunlock(ip, lock_flags);
Here in xfs_ioctl_setattr, I'm not clear on why we're messing with the user
dquot at all. Could it be removed entirely? A change in project id doesn't
effect user quota, right?
Maybe that's an idea for a separate patch.
> STATIC void
> -xfs_qm_dqattach_grouphint(
> - xfs_dquot_t *udq,
> - xfs_dquot_t *gdq)
> +xfs_qm_dqattach_hint(
> + struct xfs_inode *ip,
> + int type)
> {
> - xfs_dquot_t *tmp;
> + struct xfs_dquot **dqhint;
Maybe clearer as dqhintp.
> + struct xfs_dquot *dqp;
> + struct xfs_dquot *udq = ip->i_udquot;
>
> xfs_dqlock(udq);
>
> - tmp = udq->q_gdquot;
> - if (tmp) {
> - if (tmp == gdq)
If I understand this xfs_qm_dqattach_hint correctly, this might be nice:
ASSERT(type == XFS_DQ_GROUP || type == XFS_DQ_PROJ);
> diff --git a/fs/xfs/xfs_qm_bhv.c b/fs/xfs/xfs_qm_bhv.c
> index 2d02eac..72a4fdd 100644
> --- a/fs/xfs/xfs_qm_bhv.c
> +++ b/fs/xfs/xfs_qm_bhv.c
> @@ -115,7 +115,7 @@ xfs_qm_newmount(
> (pquotaondisk && !XFS_IS_PQUOTA_ON(mp)) ||
> (!pquotaondisk && XFS_IS_PQUOTA_ON(mp)) ||
> (gquotaondisk && !XFS_IS_GQUOTA_ON(mp)) ||
> - (!gquotaondisk && XFS_IS_OQUOTA_ON(mp))) &&
> + (!gquotaondisk && XFS_IS_GQUOTA_ON(mp))) &&
These are not in the usual user/group/project order, and so are some other
checks in this function. Could be cleaned up. Maybe a different patch too.
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2013-07-10 21:39 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-27 22:25 [PATCH v10 00/11] Allow pquota and gquota to be used together Chandra Seetharaman
2013-06-27 22:25 ` [PATCH v10 01/11] xfs: Define a new function xfs_is_quota_inode() Chandra Seetharaman
2013-06-27 22:43 ` Ben Myers
2013-06-27 22:25 ` [PATCH v10 02/11] xfs: Replace macro XFS_DQUOT_TREE with a function Chandra Seetharaman
2013-06-27 23:19 ` Ben Myers
2013-06-27 22:25 ` [PATCH v10 03/11] xfs: Replace macro XFS_DQ_TO_QIP " Chandra Seetharaman
2013-06-27 23:23 ` Ben Myers
2013-06-27 22:25 ` [PATCH v10 04/11] xfs: Code cleanup and removal of some typedef usage Chandra Seetharaman
2013-06-27 23:50 ` Ben Myers
2013-06-27 22:25 ` [PATCH v10 05/11] xfs: Do some whitespace cleanup in the data structure xfs_quotainfo Chandra Seetharaman
2013-06-28 16:30 ` Ben Myers
2013-06-28 18:14 ` Chandra Seetharaman
2013-06-28 18:31 ` Ben Myers
2013-06-27 22:25 ` [PATCH v10 06/11] xfs: Change xfs_dquot_acct to be a 2-dimensional array Chandra Seetharaman
2013-06-28 19:06 ` Ben Myers
2013-06-27 22:25 ` [PATCH v10 07/11] xfs: Remove incore use of XFS_OQUOTA_ENFD and XFS_OQUOTA_CHKD Chandra Seetharaman
2013-06-28 22:36 ` Ben Myers
2013-06-27 22:25 ` [PATCH v10 08/11] xfs: Add pquota fields where gquota is used Chandra Seetharaman
2013-07-10 21:39 ` Ben Myers [this message]
2013-07-10 21:46 ` Chandra Seetharaman
2013-07-11 1:23 ` Dave Chinner
2013-07-11 4:05 ` Chandra Seetharaman
2013-06-27 22:25 ` [PATCH v10 09/11] xfs: Start using pquotaino from the superblock Chandra Seetharaman
2013-07-01 2:06 ` Dave Chinner
2013-07-01 17:59 ` Chandra Seetharaman
2013-07-03 17:12 ` Chandra Seetharaman
2013-07-04 1:35 ` Dave Chinner
2013-06-27 22:25 ` [PATCH v10 10/11] quota: Add proper versioning support to fs_quota_stat Chandra Seetharaman
2013-07-10 15:55 ` Ben Myers
2013-07-10 16:26 ` Jan Kara
2013-07-10 18:47 ` Ben Myers
2013-07-10 21:52 ` Jan Kara
2013-07-10 20:49 ` Chandra Seetharaman
2013-07-10 21:54 ` Jan Kara
2013-07-11 1:45 ` Dave Chinner
2013-07-11 4:16 ` Chandra Seetharaman
2013-07-11 7:18 ` Dave Chinner
2013-07-11 7:51 ` Steven Whitehouse
2013-06-27 22:25 ` [PATCH v10 11/11] xfs: Use new qs_pquota field in fs_quota_stat for Q_XGETQSTAT Chandra Seetharaman
2013-06-28 22:53 ` [PATCH v10 00/11] Allow pquota and gquota to be used together Ben Myers
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=20130710213907.GZ20932@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