linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: <linux-fsdevel@vger.kernel.org>
Cc: Sascha Hauer <s.hauer@pengutronix.de>, Jan Kara <jack@suse.cz>
Subject: [PATCH 7/7] quota: Handle quotas without quota inodes in dquot_get_state()
Date: Mon,  4 Nov 2019 11:51:55 +0100	[thread overview]
Message-ID: <20191104105207.1530-7-jack@suse.cz> (raw)
In-Reply-To: <20191104091335.7991-1-jack@suse.cz>

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 <jack@suse.cz>
---
 fs/quota/dquot.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c
index 4c3da4ea31bc..a69a657209a6 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);
 	}
-- 
2.16.4


  parent reply	other threads:[~2019-11-04 10:52 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-04 10:51 [PATCH 0/7] quota: Allow quota support without quota files Jan Kara
2019-11-04 10:51 ` [PATCH 1/7] quota: Factor out setup of quota inode Jan Kara
2019-11-04 10:51 ` [PATCH 2/7] quota: Simplify dquot_resume() Jan Kara
2019-11-04 10:51 ` [PATCH 3/7] quota: Rename vfs_load_quota_inode() to dquot_load_quota_inode() Jan Kara
2019-11-04 10:51 ` [PATCH 4/7] fs: Use dquot_load_quota_inode() from filesystems Jan Kara
2019-11-04 10:51 ` [PATCH 5/7] quota: Drop dquot_enable() Jan Kara
2019-11-04 10:51 ` [PATCH 6/7] quota: Make dquot_disable() work without quota inodes Jan Kara
2019-11-04 10:51 ` Jan Kara [this message]
2019-11-06  8:17 ` [PATCH 0/7] quota: Allow quota support without quota files Sascha Hauer
2019-11-06  9:59   ` Jan Kara

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191104105207.1530-7-jack@suse.cz \
    --to=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=s.hauer@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).