orig_height = info.max_depth - info.curr_level;
orig_lblk = extent.e_lblk;
+ /* Try to put the index block before the first extent */
+ path = handle->path + handle->level;
+ eh = (struct ext3_extent_header *) path->buf;
+ if (handle->level == handle->max_depth) {
+ struct ext3_extent *ex;
+
+ ex = EXT_FIRST_EXTENT(eh);
+ goal_blk = ext2fs_le32_to_cpu(ex->ee_start) +
+ ((__u64) ext2fs_le16_to_cpu(ex->ee_start_hi) << 32);
+ } else {
+ struct ext3_extent_idx *ix;
+
+ ix = EXT_FIRST_INDEX(eh);
+ goal_blk = ext2fs_le32_to_cpu(ix->ei_leaf) +
+ ((__u64) ext2fs_le16_to_cpu(ix->ei_leaf_hi) << 32);
+ }
+ goal_blk -= EXT2FS_CLUSTER_RATIO(handle->fs);
+ goal_blk &= ~EXT2FS_CLUSTER_MASK(handle->fs);
+
/* Is there room in the parent for a new entry? */
if (handle->level &&
(handle->path[handle->level - 1].entries >=
retval = ext2fs_extent_get(handle, EXT2_EXTENT_UP, &extent);
if (retval)
goto done;
- goal_blk = extent.e_pblk;
retval = extent_node_split(handle, expand_allowed);
if (retval)
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
-Block bitmap differences: -(25--34) -(155--199)
+Block bitmap differences: -(25--33) -(154--199)
Fix? yes
Free blocks count wrong for group #0 (65535, counted=55).
Reserved GDT blocks at 2-672
Block bitmap at 673 (+673), Inode bitmap at 757 (+757)
Inode table at 841-841 (+841)
- 31836 free blocks, 5 free inodes, 2 directories, 5 unused inodes
- Free blocks: 932-32767
+ 31837 free blocks, 5 free inodes, 2 directories, 5 unused inodes
+ Free blocks: 931-32767
Free inodes: 12-16
Group 1: (Blocks 32768-65535) [INODE_UNINIT, BLOCK_UNINIT]
Backup superblock at 32768, Group descriptors at 32769-32769
32768 free blocks, 16 free inodes, 0 directories, 16 unused inodes
Free blocks: 1245184-1277951
Free inodes: 609-624
-Group 39: (Blocks 1277952-1310719) [INODE_UNINIT, BLOCK_UNINIT]
+Group 39: (Blocks 1277952-1310719) [INODE_UNINIT]
Block bitmap at 712 (bg #0 + 712), Inode bitmap at 796 (bg #0 + 796)
Inode table at 880-880 (bg #0 + 880)
- 32768 free blocks, 16 free inodes, 0 directories, 16 unused inodes
- Free blocks: 1277952-1310719
+ 32767 free blocks, 16 free inodes, 0 directories, 16 unused inodes
+ Free blocks: 1277952-1310718
Free inodes: 625-640
Group 40: (Blocks 1310720-1343487) [INODE_UNINIT]
Block bitmap at 713 (bg #0 + 713), Inode bitmap at 797 (bg #0 + 797)