xfs
[Top] [All Lists]

Re: [RFC v5 PATCH 2/4] xfs: Add pquota fields where gquota is used.

To: Chandra Seetharaman <sekharan@xxxxxxxxxx>
Subject: Re: [RFC v5 PATCH 2/4] xfs: Add pquota fields where gquota is used.
From: Ben Myers <bpm@xxxxxxx>
Date: Fri, 4 May 2012 15:00:32 -0500
Cc: xfs@xxxxxxxxxxx
In-reply-to: <20120314202636.17044.11836.sendpatchset@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
References: <20120314202623.17044.90045.sendpatchset@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> <20120314202636.17044.11836.sendpatchset@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
User-agent: Mutt/1.5.20 (2009-06-14)
On Wed, Mar 14, 2012 at 03:26:36PM -0500, Chandra Seetharaman wrote:
> diff --git a/fs/xfs/xfs_iops.c b/fs/xfs/xfs_iops.c
> index 7c01cda..8800197 100644
> --- a/fs/xfs/xfs_iops.c
> +++ b/fs/xfs/xfs_iops.c
> @@ -516,7 +516,7 @@ xfs_setattr_nonsize(
>               ASSERT(udqp == NULL);
>               ASSERT(gdqp == NULL);
>               error = xfs_qm_vop_dqalloc(ip, uid, gid, xfs_get_projid(ip),
> -                                      qflags, &udqp, &gdqp);
> +                                      qflags, &udqp, &gdqp, NULL);
>               if (error)
>                       return error;
>       }
> @@ -552,7 +552,7 @@ xfs_setattr_nonsize(
>                    (XFS_IS_GQUOTA_ON(mp) && igid != gid))) {
>                       ASSERT(tp);
>                       error = xfs_qm_vop_chown_reserve(tp, ip, udqp, gdqp,
> -                                             capable(CAP_FOWNER) ?
> +                                             NULL, capable(CAP_FOWNER) ?
>                                               XFS_QMOPT_FORCE_RES : 0);
>                       if (error)      /* out of quota */
>                               goto out_trans_cancel;

I popped an assert in xfs_setattr_nonsize in my testing.  Here is my suggestion:

Index: xfs/fs/xfs/xfs_iops.c
===================================================================
--- xfs.orig/fs/xfs/xfs_iops.c
+++ xfs/fs/xfs/xfs_iops.c
@@ -594,7 +594,8 @@ xfs_setattr_nonsize(
                }
                if (igid != gid) {
                        if (XFS_IS_QUOTA_RUNNING(mp) && XFS_IS_GQUOTA_ON(mp)) {
-                               ASSERT(!XFS_IS_PQUOTA_ON(mp));
+                               ASSERT(xfs_sb_version_has_no_oquota(&mp->m_sb)
+                                      || !XFS_IS_PQUOTA_ON(mp));
                                ASSERT(mask & ATTR_GID);
                                ASSERT(gdqp);
                                olddquot2 = xfs_qm_vop_chown(tp, ip,

-Ben

<Prev in Thread] Current Thread [Next in Thread>