summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKemeng Shi <shikemeng@huaweicloud.com>2024-07-15 21:05:31 +0800
committerJan Kara <jack@suse.cz>2024-07-22 18:13:34 +0200
commitd16a5f852025be546b6e4ceef15899db3490f4d7 (patch)
tree8db99ab49cb73eb649f22f34cf6f5aec9093de7a
parent933069701c1b507825b514317d4edd5d3fd9d417 (diff)
quota: avoid missing put_quota_format when DQUOT_SUSPENDED is passed
Avoid missing put_quota_format when DQUOT_SUSPENDED is passed to dquot_load_quota_sb. Link: https://patch.msgid.link/20240715130534.2112678-2-shikemeng@huaweicloud.com Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com> Fixes: d44c57663723 ("quota: Remove BUG_ON in dquot_load_quota_sb()") Reviewed-by: Joseph Qi <joseph.qi@linux.alibaba.com> Signed-off-by: Jan Kara <jack@suse.cz>
-rw-r--r--fs/quota/dquot.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c
index a2b256dac36e..104927804bec 100644
--- a/fs/quota/dquot.c
+++ b/fs/quota/dquot.c
@@ -2406,7 +2406,7 @@ static int vfs_setup_quota_inode(struct inode *inode, int type)
int dquot_load_quota_sb(struct super_block *sb, int type, int format_id,
unsigned int flags)
{
- struct quota_format_type *fmt = find_quota_format(format_id);
+ struct quota_format_type *fmt;
struct quota_info *dqopt = sb_dqopt(sb);
int error;
@@ -2416,6 +2416,7 @@ int dquot_load_quota_sb(struct super_block *sb, int type, int format_id,
if (WARN_ON_ONCE(flags & DQUOT_SUSPENDED))
return -EINVAL;
+ fmt = find_quota_format(format_id);
if (!fmt)
return -ESRCH;
if (!sb->dq_op || !sb->s_qcop ||