From: Jan Kara Subject: [PATCH] quota: Don't set grace time when user isn't above softlimit Date: Fri, 19 Dec 2008 01:43:42 +0100 Message-ID: <1229647422-20250-1-git-send-email-jack@suse.cz> Cc: linux-fsdevel@vger.kernel.org To: jack@suse.cz Return-path: Received: from styx.suse.cz ([82.119.242.94]:59723 "EHLO mail.suse.cz" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751519AbYLSAno (ORCPT ); Thu, 18 Dec 2008 19:43:44 -0500 Sender: linux-fsdevel-owner@vger.kernel.org List-ID: 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 --- Andrew, would you merge this patch for -mm? It's against linux-next so it should apply fine to your tree. Thanks. The bug is not serious so the fix can definitely wait till 2.6.29 merge window. fs/dquot.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/fs/dquot.c b/fs/dquot.c index 61bfff6..48c0571 100644 --- a/fs/dquot.c +++ b/fs/dquot.c @@ -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); } -- 1.6.0.2