projects
/
GitHub
/
moto-9609
/
android_kernel_motorola_exynos9610.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5bcd3b6
)
quota: paranoia: check quota tree root
author
Konstantin Khlebnikov
<khlebnikov@yandex-team.ru>
Thu, 12 Feb 2015 09:36:49 +0000
(12:36 +0300)
committer
Jan Kara
<jack@suse.cz>
Wed, 4 Mar 2015 15:42:45 +0000
(16:42 +0100)
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>
fs/quota/quota_tree.c
patch
|
blob
|
blame
|
history
diff --git
a/fs/quota/quota_tree.c
b/fs/quota/quota_tree.c
index d65877fbe8f4a389100527ce426c5e22f8fe1e88..58efb83dec1c870c672a5330fcb4571323c73914 100644
(file)
--- 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,
struct dquot *dquot)
{
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);
}