summaryrefslogtreecommitdiffstats
path: root/disk-utils/mkfs.minix.c
diff options
context:
space:
mode:
authorSami Kerola2015-08-01 20:01:00 +0200
committerKarel Zak2015-08-03 11:27:36 +0200
commit3e56e36291830f74ba5646829b4d869b565e831b (patch)
treef987e743c6c65e09149668d72850866043a745af /disk-utils/mkfs.minix.c
parentunshare: remove angular brackets from literal argument in usage text (diff)
downloadkernel-qcow2-util-linux-3e56e36291830f74ba5646829b4d869b565e831b.tar.gz
kernel-qcow2-util-linux-3e56e36291830f74ba5646829b4d869b565e831b.tar.xz
kernel-qcow2-util-linux-3e56e36291830f74ba5646829b4d869b565e831b.zip
mkfs.minix: re-fix block count maths
Error, that Joshua Hudson already pointed out, creapped back to commit da41ff5 when changes were applied from mailbox rather than git remote, as the corrected change had included some accidental rubbish. Reference: http://www.spinics.net/lists/util-linux-ng/msg11764.html Reference: http://www.spinics.net/lists/util-linux-ng/msg11848.html Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'disk-utils/mkfs.minix.c')
-rw-r--r--disk-utils/mkfs.minix.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/disk-utils/mkfs.minix.c b/disk-utils/mkfs.minix.c
index 16305b23f..2da0e6878 100644
--- a/disk-utils/mkfs.minix.c
+++ b/disk-utils/mkfs.minix.c
@@ -706,8 +706,8 @@ static void determine_device_blocks(struct fs_control *ctl, const struct stat *s
errx(MKFS_EX_ERROR, _("%s: number of blocks too small"), ctl->device_name);
if (fs_version == 1 && ctl->fs_blocks > MINIX_MAX_INODES)
ctl->fs_blocks = MINIX_MAX_INODES;
- if (ctl->fs_blocks > MINIX_MAX_INODES * BITS_PER_BLOCK)
- ctl->fs_blocks = MINIX_MAX_INODES * BITS_PER_BLOCK; /* Utter maximum: Clip. */
+ if (ctl->fs_blocks > (4 + ((MINIX_MAX_INODES - 4) * BITS_PER_BLOCK)))
+ ctl->fs_blocks = 4 + ((MINIX_MAX_INODES - 4) * BITS_PER_BLOCK); /* Utter maximum: Clip. */
}
static void check_user_instructions(struct fs_control *ctl)