aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ext4')
-rw-r--r--fs/ext4/extents.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index 1442ccbaea79..994a6e450e06 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -1531,16 +1531,17 @@ int inline ext4_ext_calc_credits_for_insert(struct inode *inode,
1531 1531
1532 /* 1532 /*
1533 * tree can be full, so it would need to grow in depth: 1533 * tree can be full, so it would need to grow in depth:
1534 * allocation + old root + new root 1534 * we need one credit to modify old root, credits for
1535 * new root will be added in split accounting
1535 */ 1536 */
1536 needed += 2 + 1 + 1; 1537 needed += 1;
1537 1538
1538 /* 1539 /*
1539 * Index split can happen, we would need: 1540 * Index split can happen, we would need:
1540 * allocate intermediate indexes (bitmap + group) 1541 * allocate intermediate indexes (bitmap + group)
1541 * + change two blocks at each level, but root (already included) 1542 * + change two blocks at each level, but root (already included)
1542 */ 1543 */
1543 needed = (depth * 2) + (depth * 2); 1544 needed += (depth * 2) + (depth * 2);
1544 1545
1545 /* any allocation modifies superblock */ 1546 /* any allocation modifies superblock */
1546 needed += 1; 1547 needed += 1;