* [PATCH] ext4: Simplify checking quota limits in ext4_statfs()
@ 2020-01-30 11:11 Jan Kara
2020-02-13 15:14 ` [PATCH] ext4: simplify " Theodore Y. Ts'o
0 siblings, 1 reply; 2+ messages in thread
From: Jan Kara @ 2020-01-30 11:11 UTC (permalink / raw)
To: Ted Tso; +Cc: linux-ext4, Jan Kara
Coverity reports that conditions checking quota limits in ext4_statfs()
contain dead code. Indeed it is right and current conditions can be
simplified.
Reported-by: Coverity <scan-admin@coverity.com>
Signed-off-by: Jan Kara <jack@suse.cz>
---
fs/ext4/super.c | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
Note, currently this applies to 'dev' branch in ext4.git.
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 88b213bd32bc..f23367a779e8 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -5585,10 +5585,7 @@ static int ext4_statfs_project(struct super_block *sb,
return PTR_ERR(dquot);
spin_lock(&dquot->dq_dqb_lock);
- limit = 0;
- if (dquot->dq_dqb.dqb_bsoftlimit &&
- (!limit || dquot->dq_dqb.dqb_bsoftlimit < limit))
- limit = dquot->dq_dqb.dqb_bsoftlimit;
+ limit = dquot->dq_dqb.dqb_bsoftlimit;
if (dquot->dq_dqb.dqb_bhardlimit &&
(!limit || dquot->dq_dqb.dqb_bhardlimit < limit))
limit = dquot->dq_dqb.dqb_bhardlimit;
@@ -5603,10 +5600,7 @@ static int ext4_statfs_project(struct super_block *sb,
(buf->f_blocks - curblock) : 0;
}
- limit = 0;
- if (dquot->dq_dqb.dqb_isoftlimit &&
- (!limit || dquot->dq_dqb.dqb_isoftlimit < limit))
- limit = dquot->dq_dqb.dqb_isoftlimit;
+ limit = dquot->dq_dqb.dqb_isoftlimit;
if (dquot->dq_dqb.dqb_ihardlimit &&
(!limit || dquot->dq_dqb.dqb_ihardlimit < limit))
limit = dquot->dq_dqb.dqb_ihardlimit;
--
2.16.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ext4: simplify checking quota limits in ext4_statfs()
2020-01-30 11:11 [PATCH] ext4: Simplify checking quota limits in ext4_statfs() Jan Kara
@ 2020-02-13 15:14 ` Theodore Y. Ts'o
0 siblings, 0 replies; 2+ messages in thread
From: Theodore Y. Ts'o @ 2020-02-13 15:14 UTC (permalink / raw)
To: Jan Kara; +Cc: linux-ext4
On Thu, Jan 30, 2020 at 12:11:48PM +0100, Jan Kara wrote:
> Coverity reports that conditions checking quota limits in ext4_statfs()
> contain dead code. Indeed it is right and current conditions can be
> simplified.
>
> Reported-by: Coverity <scan-admin@coverity.com>
> Signed-off-by: Jan Kara <jack@suse.cz>
Applied, thanks.
- Ted
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-02-13 15:14 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-30 11:11 [PATCH] ext4: Simplify checking quota limits in ext4_statfs() Jan Kara
2020-02-13 15:14 ` [PATCH] ext4: simplify " Theodore Y. Ts'o
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.