quota: don't set grace time when user isn't above softlimit
authorJan Kara <jack@suse.cz>
Thu, 8 Jan 2009 02:07:29 +0000 (18:07 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 8 Jan 2009 16:31:01 +0000 (08:31 -0800)
do_set_dqblk() allowed SETDQBLK quotactl to set user's grace time even if
user was not above his softlimit.  This does not make much sence and by
coincidence causes quota code to omit softlimit warning when user really
exceeds softlimit.  This patch makes do_set_dqblk() reset user's grace
time if he has not exceeded softlimit.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/dquot.c

index 61bfff64e5af1368a37801311ebe9aed39f42e1e..48c0571f831d5fc72d7724f54ffab6ea1d61849a 100644 (file)
@@ -2090,10 +2090,12 @@ static int do_set_dqblk(struct dquot *dquot, struct if_dqblk *di)
        }
        if (di->dqb_valid & QIF_BTIME) {
                dm->dqb_btime = di->dqb_btime;
+               check_blim = 1;
                __set_bit(DQ_LASTSET_B + QIF_BTIME_B, &dquot->dq_flags);
        }
        if (di->dqb_valid & QIF_ITIME) {
                dm->dqb_itime = di->dqb_itime;
+               check_ilim = 1;
                __set_bit(DQ_LASTSET_B + QIF_ITIME_B, &dquot->dq_flags);
        }