diff options
Diffstat (limited to 'util-linux/mkfs_ext2.c')
-rw-r--r-- | util-linux/mkfs_ext2.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/util-linux/mkfs_ext2.c b/util-linux/mkfs_ext2.c index 5cd923811..06858ef7b 100644 --- a/util-linux/mkfs_ext2.c +++ b/util-linux/mkfs_ext2.c | |||
@@ -605,16 +605,17 @@ int mkfs_ext2_main(int argc UNUSED_PARAM, char **argv) | |||
605 | PUT(((uint64_t)FETCH_LE32(gd[0].bg_inode_table) * blocksize) + (EXT2_GOOD_OLD_FIRST_INO-1) * sizeof(*inode), | 605 | PUT(((uint64_t)FETCH_LE32(gd[0].bg_inode_table) * blocksize) + (EXT2_GOOD_OLD_FIRST_INO-1) * sizeof(*inode), |
606 | buf, sizeof(*inode)); | 606 | buf, sizeof(*inode)); |
607 | 607 | ||
608 | // zero the blocks for "/lost+found" | 608 | // dump directories |
609 | memset(buf, 0, blocksize); | 609 | memset(buf, 0, blocksize); |
610 | dir = (struct ext2_dir *)buf; | ||
611 | |||
612 | // dump 2nd+ blocks of "/lost+found" | ||
613 | STORE_LE(dir->rec_len1, blocksize); // e2fsck 1.41.4 compat | ||
610 | for (i = 1; i < lost_and_found_blocks; ++i) | 614 | for (i = 1; i < lost_and_found_blocks; ++i) |
611 | PUT((uint64_t)(FETCH_LE32(gd[0].bg_inode_table) + inode_table_blocks + 1+i) * blocksize, | 615 | PUT((uint64_t)(FETCH_LE32(gd[0].bg_inode_table) + inode_table_blocks + 1+i) * blocksize, |
612 | buf, blocksize); | 616 | buf, blocksize); |
613 | 617 | ||
614 | // dump directories | 618 | // dump 1st block of "/lost+found" |
615 | dir = (struct ext2_dir *)buf; | ||
616 | |||
617 | // dump lost+found dir block | ||
618 | STORE_LE(dir->inode1, EXT2_GOOD_OLD_FIRST_INO); | 619 | STORE_LE(dir->inode1, EXT2_GOOD_OLD_FIRST_INO); |
619 | STORE_LE(dir->rec_len1, 12); | 620 | STORE_LE(dir->rec_len1, 12); |
620 | STORE_LE(dir->name_len1, 1); | 621 | STORE_LE(dir->name_len1, 1); |