From 6588999f9b2e32d258aa165f6292aecd7e684561 Mon Sep 17 00:00:00 2001 From: Johann Lombardi Date: Wed, 6 Dec 2006 20:40:46 -0800 Subject: [PATCH] --- yaml --- r: 42962 b: refs/heads/master c: feb189274638ea357750a9e809f5a6e2223a082e h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/ext4/extents.c | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index 0cd85d1754a1..578821aed018 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 97d2a80584b30b5cd32da411deca1986ef61877a +refs/heads/master: feb189274638ea357750a9e809f5a6e2223a082e diff --git a/trunk/fs/ext4/extents.c b/trunk/fs/ext4/extents.c index 1442ccbaea79..994a6e450e06 100644 --- a/trunk/fs/ext4/extents.c +++ b/trunk/fs/ext4/extents.c @@ -1531,16 +1531,17 @@ int inline ext4_ext_calc_credits_for_insert(struct inode *inode, /* * tree can be full, so it would need to grow in depth: - * allocation + old root + new root + * we need one credit to modify old root, credits for + * new root will be added in split accounting */ - needed += 2 + 1 + 1; + needed += 1; /* * Index split can happen, we would need: * allocate intermediate indexes (bitmap + group) * + change two blocks at each level, but root (already included) */ - needed = (depth * 2) + (depth * 2); + needed += (depth * 2) + (depth * 2); /* any allocation modifies superblock */ needed += 1;