aboutsummaryrefslogtreecommitdiff
path: root/util-linux/mkfs_ext2.c
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2009-10-21 14:01:25 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2009-10-21 14:01:25 +0200
commitece01ee8cac0318b96f55085da68799b516406a4 (patch)
tree3e7a85ec519294a7a4003d7341318bd8c6bd2d94 /util-linux/mkfs_ext2.c
parent2ee2724a41f195f8a5e3e4e9ebc54dadc255d6f7 (diff)
downloadbusybox-ece01ee8cac0318b96f55085da68799b516406a4.tar.gz
mkfs_ext2: e2fsck 1.14.4 compat
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'util-linux/mkfs_ext2.c')
-rw-r--r--util-linux/mkfs_ext2.c11
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)
PUT(((uint64_t)FETCH_LE32(gd[0].bg_inode_table) * blocksize) + (EXT2_GOOD_OLD_FIRST_INO-1) * sizeof(*inode),
buf, sizeof(*inode));
- // zero the blocks for "/lost+found"
+ // dump directories
memset(buf, 0, blocksize);
+ dir = (struct ext2_dir *)buf;
+
+ // dump 2nd+ blocks of "/lost+found"
+ STORE_LE(dir->rec_len1, blocksize); // e2fsck 1.41.4 compat
for (i = 1; i < lost_and_found_blocks; ++i)
PUT((uint64_t)(FETCH_LE32(gd[0].bg_inode_table) + inode_table_blocks + 1+i) * blocksize,
buf, blocksize);
- // dump directories
- dir = (struct ext2_dir *)buf;
-
- // dump lost+found dir block
+ // dump 1st block of "/lost+found"
STORE_LE(dir->inode1, EXT2_GOOD_OLD_FIRST_INO);
STORE_LE(dir->rec_len1, 12);
STORE_LE(dir->name_len1, 1);