Whamcloud - gitweb
LU-805 quota: lfs quota doesn't print grace time correctly
authorNiu Yawei <niu@whamcloud.com>
Tue, 8 Nov 2011 13:07:05 +0000 (05:07 -0800)
committerOleg Drokin <green@whamcloud.com>
Wed, 4 Jan 2012 16:00:07 +0000 (11:00 -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: Ia564c803ca33b2cf925759b6a6e4e4df2692f28d
Reviewed-on: http://review.whamcloud.com/1674
Reviewed-by: Fan Yong <yong.fan@whamcloud.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/utils/lfs.c

index 9694bac..683556d 100644 (file)
@@ -1945,8 +1945,7 @@ static void print_quota(char *mnt, struct if_quotactl *qctl, int type, int rc)
                 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 {
@@ -1957,8 +1956,7 @@ static void print_quota(char *mnt, struct if_quotactl *qctl, int type, int rc)
                 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 {