Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-6]: src/sys/ufs/ufs Pull up following revision(s) (requested by b...



details:   https://anonhg.NetBSD.org/src/rev/2a3a9fbc2080
branches:  netbsd-6
changeset: 776587:2a3a9fbc2080
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Tue Mar 18 08:43:33 2014 +0000

description:
Pull up following revision(s) (requested by bouyer in ticket #1027):
        sys/ufs/ufs/ufs_quota2.c: revision 1.37
Patch from Edgar Fuss on tech-kern:
set grace time if lowering the limit cause the user/group to now be overquota.

diffstat:

 sys/ufs/ufs/ufs_quota2.c |  14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diffs (42 lines):

diff -r c8418682cbae -r 2a3a9fbc2080 sys/ufs/ufs/ufs_quota2.c
--- a/sys/ufs/ufs/ufs_quota2.c  Tue Mar 18 08:22:45 2014 +0000
+++ b/sys/ufs/ufs/ufs_quota2.c  Tue Mar 18 08:43:33 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ufs_quota2.c,v 1.34.2.1 2012/10/01 19:55:22 riz Exp $ */
+/* $NetBSD: ufs_quota2.c,v 1.34.2.2 2014/03/18 08:43:33 msaitoh Exp $ */
 /*-
   * Copyright (c) 2010 Manuel Bouyer
   * All rights reserved.
@@ -26,7 +26,7 @@
   */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ufs_quota2.c,v 1.34.2.1 2012/10/01 19:55:22 riz Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ufs_quota2.c,v 1.34.2.2 2014/03/18 08:43:33 msaitoh Exp $");
 
 #include <sys/buf.h>
 #include <sys/param.h>
@@ -42,6 +42,7 @@
 #include <sys/wapbl.h>
 #include <sys/quota.h>
 #include <sys/quotactl.h>
+#include <sys/timevar.h>
 
 #include <ufs/ufs/quota2.h>
 #include <ufs/ufs/inode.h>
@@ -631,6 +632,15 @@
                goto out_il;
        
        quota2_ufs_rwq2e(q2ep, &q2e, needswap);
+       /*
+        * Reset time limit if previously had no soft limit or were
+        * under it, but now have a soft limit and are over it.
+        */
+       if (val->qv_softlimit &&
+           q2e.q2e_val[key->qk_objtype].q2v_cur >= val->qv_softlimit &&
+           (q2e.q2e_val[key->qk_objtype].q2v_softlimit == 0 ||
+            q2e.q2e_val[key->qk_objtype].q2v_cur < q2e.q2e_val[key->qk_objtype].q2v_softlimit))
+               q2e.q2e_val[key->qk_objtype].q2v_time = time_second + val->qv_grace;
        quota2_dict_update_q2e_limits(key->qk_objtype, val, &q2e);
        quota2_ufs_rwq2e(&q2e, q2ep, needswap);
        quota2_bwrite(ump->um_mountp, bp);



Home | Main Index | Thread Index | Old Index