diff options
| author | Konstantin Khlebnikov <khlebnikov@yandex-team.ru> | 2015-02-12 04:36:49 -0500 |
|---|---|---|
| committer | Jan Kara <jack@suse.cz> | 2015-03-04 10:42:45 -0500 |
| commit | 69a25ee217ba8c93a6d4c6671d9208c0155c0485 (patch) | |
| tree | 73a30e75c15e5d0a6533db1852e4b193491e3e6a | |
| parent | 5bcd3b6f639c277ed7fa71f2f8ed6fb072615011 (diff) | |
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: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
Signed-off-by: Jan Kara <jack@suse.cz>
| -rw-r--r-- | fs/quota/quota_tree.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/quota/quota_tree.c b/fs/quota/quota_tree.c index d65877fbe8f4..58efb83dec1c 100644 --- a/fs/quota/quota_tree.c +++ b/fs/quota/quota_tree.c | |||
| @@ -349,6 +349,13 @@ static inline int dq_insert_tree(struct qtree_mem_dqinfo *info, | |||
| 349 | struct dquot *dquot) | 349 | struct dquot *dquot) |
| 350 | { | 350 | { |
| 351 | int tmp = QT_TREEOFF; | 351 | int tmp = QT_TREEOFF; |
| 352 | |||
| 353 | #ifdef __QUOTA_QT_PARANOIA | ||
| 354 | if (info->dqi_blocks <= QT_TREEOFF) { | ||
| 355 | quota_error(dquot->dq_sb, "Quota tree root isn't allocated!"); | ||
| 356 | return -EIO; | ||
| 357 | } | ||
| 358 | #endif | ||
| 352 | return do_insert_tree(info, dquot, &tmp, 0); | 359 | return do_insert_tree(info, dquot, &tmp, 0); |
| 353 | } | 360 | } |
| 354 | 361 | ||
