aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/ext4/extents.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index f554703eb924..f7529e27d791 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -1910,9 +1910,13 @@ ext4_ext_rm_leaf(handle_t *handle, struct inode *inode,
1910 BUG_ON(b != ex_ee_block + ex_ee_len - 1); 1910 BUG_ON(b != ex_ee_block + ex_ee_len - 1);
1911 } 1911 }
1912 1912
1913 /* at present, extent can't cross block group: */ 1913 /*
1914 /* leaf + bitmap + group desc + sb + inode */ 1914 * 3 for leaf, sb, and inode plus 2 (bmap and group
1915 credits = 5; 1915 * descriptor) for each block group; assume two block
1916 * groups plus ex_ee_len/blocks_per_block_group for
1917 * the worst case
1918 */
1919 credits = 7 + 2*(ex_ee_len/EXT4_BLOCKS_PER_GROUP(inode->i_sb));
1916 if (ex == EXT_FIRST_EXTENT(eh)) { 1920 if (ex == EXT_FIRST_EXTENT(eh)) {
1917 correct_index = 1; 1921 correct_index = 1;
1918 credits += (ext_depth(inode)) + 1; 1922 credits += (ext_depth(inode)) + 1;