#43 quota_nld: multicast project quota warnings via dbus

None
closed-accepted
Jan Kara
None
5
2015-12-17
2015-11-26
No
commit 35691292899db84aaec7842bdb24f4908d57e76e
Author: Masatake YAMATO <yamato@localhost.localdomain>
Date:   Tue Nov 17 17:25:08 2015 +0900

    quota_nld: multicast project quota warnings via dbus

    Quota subsystem in kernel introduced project quota. This patch
    improves the userspace side.

    This patch prevents quota_nld writing warnings to a console when
    receiving project quota warnings from kernel because there is no such
    concept, "console associated with a project id".

    Signed-off-by: Masatake YAMATO <yamato@redhat.com>

diff --git a/quota.h b/quota.h
index 6787eab..0c38427 100644
--- a/quota.h
+++ b/quota.h
@@ -11,6 +11,7 @@ typedef int64_t qsize_t;  /* Type in which we store size limitations */
 #define MAXQUOTAS 2
 #define USRQUOTA  0        /* element used for user quotas */
 #define GRPQUOTA  1        /* element used for group quotas */
+#define PRJQUOTA  2        /* element used for project quotas */

 /*
  * Definitions for the default names of the quotas files.
diff --git a/quota_nld.c b/quota_nld.c
index ad5c57e..a951db6 100644
--- a/quota_nld.c
+++ b/quota_nld.c
@@ -165,7 +165,7 @@ static int quota_nl_parser(struct nl_msg *msg, void *arg)
    warn.dev_minor = nla_get_u32(attrs[QUOTA_NL_A_DEV_MINOR]);
    warn.caused_id = nla_get_u64(attrs[QUOTA_NL_A_CAUSED_ID]);

-   if (!(flags & FL_NOCONSOLE))
+   if ((!(flags & FL_NOCONSOLE)) && (warn.qtype != PRJQUOTA))
        write_console_warning(&warn);
    if (!(flags & FL_NODBUS))
        write_dbus_warning(dhandle, &warn);

Discussion

  • Jan Kara

    Jan Kara - 2015-12-16

    Thanks I have applied the patch. But please create patches as attachments next time - I didn't find a way of grabbing patch easily from Sourceforge comment.

     
  • Jan Kara

    Jan Kara - 2015-12-16
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,4 +1,3 @@
    -
     ~~~~
     commit 35691292899db84aaec7842bdb24f4908d57e76e
     Author: Masatake YAMATO <yamato@localhost.localdomain>
    
    • status: open --> closed-accepted
    • assigned_to: Jan Kara
    • Group: -->
     
  • Masatake YAMATO

    Masatake YAMATO - 2015-12-17

    Thank you.
    I'm sorry, I didn't know the way to attach the patch.
    I could not find an icon for attaching it in icons above. Now I foud a link for attaching below.

     


Anonymous

Cancel  Add attachments