From: Jan Kara Date: Mon, 4 Nov 2019 10:18:17 +0000 (+0100) Subject: quota: Handle quotas without quota inodes in dquot_get_state() X-Git-Tag: v5.15~5033^2~8^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a0828b6ccbdfd46afbbaa9f28df359081c29109b;p=platform%2Fkernel%2Flinux-starfive.git quota: Handle quotas without quota inodes in dquot_get_state() Make dquot_get_state() gracefully handle a situation when there are no quota files present even though quotas are enabled. Signed-off-by: Jan Kara --- diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c index 4c3da4e..a69a657 100644 --- a/fs/quota/dquot.c +++ b/fs/quota/dquot.c @@ -2787,8 +2787,10 @@ int dquot_get_state(struct super_block *sb, struct qc_state *state) tstate->flags |= QCI_LIMITS_ENFORCED; tstate->spc_timelimit = mi->dqi_bgrace; tstate->ino_timelimit = mi->dqi_igrace; - tstate->ino = dqopt->files[type]->i_ino; - tstate->blocks = dqopt->files[type]->i_blocks; + if (dqopt->files[type]) { + tstate->ino = dqopt->files[type]->i_ino; + tstate->blocks = dqopt->files[type]->i_blocks; + } tstate->nextents = 1; /* We don't know... */ spin_unlock(&dq_data_lock); }