From 7252874a48e3cc7382d579254a19fc4c309442c1 Mon Sep 17 00:00:00 2001 From: Ruediger Meier Date: Tue, 1 Mar 2016 21:03:13 +0100 Subject: mkfs.minix: fix v2/v3 .badblocks inode number for big endian For minix v2/v3 on big endian systems the inode number of the unwanted ".badblocks" file was not set to zero. This was introduced when v3 was added in a2657ae3. Actually it did not seem to cause any problems but since we zero it out at all we should do it correctly. Now we zero out the whole directory entry (inclusive ".badblocks" file name, also for v1). Unfortunately we have to update the test data checksums. CC: Davidlohr Bueso Signed-off-by: Ruediger Meier --- disk-utils/mkfs.minix.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'disk-utils') diff --git a/disk-utils/mkfs.minix.c b/disk-utils/mkfs.minix.c index b472242ed..24e618871 100644 --- a/disk-utils/mkfs.minix.c +++ b/disk-utils/mkfs.minix.c @@ -369,8 +369,7 @@ static void make_root_inode_v1(struct fs_control *ctl) { if (ctl->fs_bad_blocks) inode->i_size = 3 * ctl->fs_dirsize; else { - root_block[2 * ctl->fs_dirsize] = '\0'; - root_block[2 * ctl->fs_dirsize + 1] = '\0'; + memset(&root_block[2 * ctl->fs_dirsize], 0, ctl->fs_dirsize); inode->i_size = 2 * ctl->fs_dirsize; } inode->i_mode = S_IFDIR + 0755; @@ -391,7 +390,7 @@ static void make_root_inode_v2_v3 (struct fs_control *ctl) { if (ctl->fs_bad_blocks) inode->i_size = 3 * ctl->fs_dirsize; else { - root_block[2 * ctl->fs_dirsize] = '\0'; + memset(&root_block[2 * ctl->fs_dirsize], 0, ctl->fs_dirsize); inode->i_size = 2 * ctl->fs_dirsize; } -- cgit v1.2.3-55-g7522