Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 69a25ee2 authored by Konstantin Khlebnikov's avatar Konstantin Khlebnikov Committed by Jan Kara
Browse files

quota: paranoia: check quota tree root



Root level in quota tree must be already allocated otherwise this block
could be used for something else.

Signed-off-by: default avatarKonstantin Khlebnikov <khlebnikov@yandex-team.ru>
Signed-off-by: default avatarJan Kara <jack@suse.cz>
parent 5bcd3b6f
Loading
Loading
Loading
Loading
+7 −0
Original line number Original line Diff line number Diff line
@@ -349,6 +349,13 @@ static inline int dq_insert_tree(struct qtree_mem_dqinfo *info,
				 struct dquot *dquot)
				 struct dquot *dquot)
{
{
	int tmp = QT_TREEOFF;
	int tmp = QT_TREEOFF;

#ifdef __QUOTA_QT_PARANOIA
	if (info->dqi_blocks <= QT_TREEOFF) {
		quota_error(dquot->dq_sb, "Quota tree root isn't allocated!");
		return -EIO;
	}
#endif
	return do_insert_tree(info, dquot, &tmp, 0);
	return do_insert_tree(info, dquot, &tmp, 0);
}
}