From: Niu Yawei Date: Tue, 8 Nov 2011 13:07:05 +0000 (-0800) Subject: LU-805 quota: lfs quota doesn't print grace time correctly X-Git-Tag: 2.1.54~31 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=a9b5457bc7168393803d692a016909528dc07725;p=fs%2Flustre-release.git LU-805 quota: lfs quota doesn't print grace time correctly 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 Change-Id: Ia564c803ca33b2cf925759b6a6e4e4df2692f28d Reviewed-on: http://review.whamcloud.com/1674 Reviewed-by: Fan Yong Tested-by: Hudson Tested-by: Maloo Reviewed-by: Oleg Drokin --- diff --git a/lustre/utils/lfs.c b/lustre/utils/lfs.c index 9694bac..683556d 100644 --- a/lustre/utils/lfs.c +++ b/lustre/utils/lfs.c @@ -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 {