xfs: send warning of project quota to userspace via netlink
authorMasatake YAMATO <yamato@redhat.com>
Mon, 4 Jan 2016 05:10:42 +0000 (16:10 +1100)
committerDave Chinner <david@fromorbit.com>
Mon, 4 Jan 2016 05:10:42 +0000 (16:10 +1100)
Linux's quota subsystem has an ability to handle project quota. This
commit just utilizes the ability from xfs side.  dbus-monitor and
quota_nld shipped as part of quota-tools can be used for testing.
See the patch posting on the XFS list for details on testing.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
fs/xfs/xfs_trans_dquot.c

index ce78534a047eebe9a1b86cec00f7f4b3f396489b..995170194df040b5b3e02cab80b5942ee92cb2ad 100644 (file)
@@ -572,12 +572,16 @@ xfs_quota_warn(
        struct xfs_dquot        *dqp,
        int                     type)
 {
-       /* no warnings for project quotas - we just return ENOSPC later */
+       enum quota_type qtype;
+
        if (dqp->dq_flags & XFS_DQ_PROJ)
-               return;
-       quota_send_warning(make_kqid(&init_user_ns,
-                                    (dqp->dq_flags & XFS_DQ_USER) ?
-                                    USRQUOTA : GRPQUOTA,
+               qtype = PRJQUOTA;
+       else if (dqp->dq_flags & XFS_DQ_USER)
+               qtype = USRQUOTA;
+       else
+               qtype = GRPQUOTA;
+
+       quota_send_warning(make_kqid(&init_user_ns, qtype,
                                     be32_to_cpu(dqp->q_core.d_id)),
                           mp->m_super->s_dev, type);
 }