diff mbox series

[01/11] quota: Make inode optional

Message ID 20190814121834.13983-2-s.hauer@pengutronix.de
State Changes Requested
Headers show
Series Add quota support to UBIFS | expand

Commit Message

Sascha Hauer Aug. 14, 2019, 12:18 p.m. UTC
To add support for filesystems which do not store quota informations in
an inode make the inode optional.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 fs/quota/dquot.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c
index be9c471cdbc8..3cb836351c22 100644
--- a/fs/quota/dquot.c
+++ b/fs/quota/dquot.c
@@ -2800,8 +2800,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);
 	}