diff options
author | Ruediger Meier | 2016-03-01 21:03:13 +0100 |
---|---|---|
committer | Ruediger Meier | 2016-03-03 09:25:10 +0100 |
commit | 7252874a48e3cc7382d579254a19fc4c309442c1 (patch) | |
tree | 8d896cde6be586d9fc5462924ab508aeaafd2cec /disk-utils/mkfs.minix.c | |
parent | fsck.minix: fix v3 version offset (diff) | |
download | kernel-qcow2-util-linux-7252874a48e3cc7382d579254a19fc4c309442c1.tar.gz kernel-qcow2-util-linux-7252874a48e3cc7382d579254a19fc4c309442c1.tar.xz kernel-qcow2-util-linux-7252874a48e3cc7382d579254a19fc4c309442c1.zip |
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 <davidlohr@hp.com>
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Diffstat (limited to 'disk-utils/mkfs.minix.c')
-rw-r--r-- | disk-utils/mkfs.minix.c | 5 |
1 files changed, 2 insertions, 3 deletions
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; } |