* [PATCH] quota: fix condition for resetting time limit in do_set_dqblk()
@ 2019-07-24 5:32 Chengguang Xu
2019-07-30 16:34 ` Jan Kara
0 siblings, 1 reply; 2+ messages in thread
From: Chengguang Xu @ 2019-07-24 5:32 UTC (permalink / raw)
To: jack; +Cc: linux-kernel, Chengguang Xu
We reset time limit when current usage is smaller
or equal to soft limit in other place, so follow
this rule in do_set_dqblk().
Signed-off-by: Chengguang Xu <cgxu519@zoho.com.cn>
---
fs/quota/dquot.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c
index be9c471cdbc8..6e826b454082 100644
--- a/fs/quota/dquot.c
+++ b/fs/quota/dquot.c
@@ -2731,7 +2731,7 @@ static int do_set_dqblk(struct dquot *dquot, struct qc_dqblk *di)
if (check_blim) {
if (!dm->dqb_bsoftlimit ||
- dm->dqb_curspace + dm->dqb_rsvspace < dm->dqb_bsoftlimit) {
+ dm->dqb_curspace + dm->dqb_rsvspace <= dm->dqb_bsoftlimit) {
dm->dqb_btime = 0;
clear_bit(DQ_BLKS_B, &dquot->dq_flags);
} else if (!(di->d_fieldmask & QC_SPC_TIMER))
@@ -2740,7 +2740,7 @@ static int do_set_dqblk(struct dquot *dquot, struct qc_dqblk *di)
}
if (check_ilim) {
if (!dm->dqb_isoftlimit ||
- dm->dqb_curinodes < dm->dqb_isoftlimit) {
+ dm->dqb_curinodes <= dm->dqb_isoftlimit) {
dm->dqb_itime = 0;
clear_bit(DQ_INODES_B, &dquot->dq_flags);
} else if (!(di->d_fieldmask & QC_INO_TIMER))
--
2.20.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] quota: fix condition for resetting time limit in do_set_dqblk()
2019-07-24 5:32 [PATCH] quota: fix condition for resetting time limit in do_set_dqblk() Chengguang Xu
@ 2019-07-30 16:34 ` Jan Kara
0 siblings, 0 replies; 2+ messages in thread
From: Jan Kara @ 2019-07-30 16:34 UTC (permalink / raw)
To: Chengguang Xu; +Cc: Jan Kara, linux-kernel
On Wed 24-07-19 13:32:16, Chengguang Xu wrote:
> We reset time limit when current usage is smaller
> or equal to soft limit in other place, so follow
> this rule in do_set_dqblk().
>
> Signed-off-by: Chengguang Xu <cgxu519@zoho.com.cn>
Thanks! Applied.
Honza
> ---
> fs/quota/dquot.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c
> index be9c471cdbc8..6e826b454082 100644
> --- a/fs/quota/dquot.c
> +++ b/fs/quota/dquot.c
> @@ -2731,7 +2731,7 @@ static int do_set_dqblk(struct dquot *dquot, struct qc_dqblk *di)
>
> if (check_blim) {
> if (!dm->dqb_bsoftlimit ||
> - dm->dqb_curspace + dm->dqb_rsvspace < dm->dqb_bsoftlimit) {
> + dm->dqb_curspace + dm->dqb_rsvspace <= dm->dqb_bsoftlimit) {
> dm->dqb_btime = 0;
> clear_bit(DQ_BLKS_B, &dquot->dq_flags);
> } else if (!(di->d_fieldmask & QC_SPC_TIMER))
> @@ -2740,7 +2740,7 @@ static int do_set_dqblk(struct dquot *dquot, struct qc_dqblk *di)
> }
> if (check_ilim) {
> if (!dm->dqb_isoftlimit ||
> - dm->dqb_curinodes < dm->dqb_isoftlimit) {
> + dm->dqb_curinodes <= dm->dqb_isoftlimit) {
> dm->dqb_itime = 0;
> clear_bit(DQ_INODES_B, &dquot->dq_flags);
> } else if (!(di->d_fieldmask & QC_INO_TIMER))
> --
> 2.20.1
>
>
>
>
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-07-30 16:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-24 5:32 [PATCH] quota: fix condition for resetting time limit in do_set_dqblk() Chengguang Xu
2019-07-30 16:34 ` Jan Kara
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome