Whamcloud - gitweb
LU-805 quota: lfs quota doesn't print grace time correctly
authorNiu Yawei <niu@whamcloud.com>
Tue, 8 Nov 2011 10:01:05 +0000 (02:01 -0800)
committerJohann Lombardi <johann@whamcloud.com>
Thu, 5 Jan 2012 22:37:58 +0000 (17:37 -0500)
Lustre always trigger grace time when the allocated qunit exceeding
softlimit, however, user tools 'lfs quota' only print grace time
when the total usage greater than softlimit, so sometimes user can't
tell if the softlimit is already exceeded from 'lfs quota' output.

This patch changes the 'lfs quota' to use the data get from kernel
instead of comparing usage with softlimit.

Signed-off-by: Niu Yawei <niu@whamcloud.com>
Change-Id: I320cd0fafcb92e8b91f688b2c8bb50bc44442a09
Reviewed-on: http://review.whamcloud.com/1667
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Johann Lombardi <johann@whamcloud.com>
lustre/utils/lfs.c

index 0c903b4..86c5468 100644 (file)
@@ -2004,8 +2004,7 @@ static void print_quota(char *mnt, struct if_quotactl *qctl, int type)
                 if (dqb->dqb_bhardlimit &&
                     toqb(dqb->dqb_curspace) >= dqb->dqb_bhardlimit) {
                         bover = 1;
-                } else if (dqb->dqb_bsoftlimit &&
-                           toqb(dqb->dqb_curspace) >= dqb->dqb_bsoftlimit) {
+                } else if (dqb->dqb_bsoftlimit && dqb->dqb_btime) {
                         if (dqb->dqb_btime > now) {
                                 bover = 2;
                         } else {
@@ -2016,8 +2015,7 @@ static void print_quota(char *mnt, struct if_quotactl *qctl, int type)
                 if (dqb->dqb_ihardlimit &&
                     dqb->dqb_curinodes >= dqb->dqb_ihardlimit) {
                         iover = 1;
-                } else if (dqb->dqb_isoftlimit &&
-                           dqb->dqb_curinodes >= dqb->dqb_isoftlimit) {
+                } else if (dqb->dqb_isoftlimit && dqb->dqb_itime) {
                         if (dqb->dqb_btime > now) {
                                 iover = 2;
                         } else {