From: Sami Kerola <kerolasa@iki.fi>
To: util-linux@vger.kernel.org
Cc: Sami Kerola <kerolasa@iki.fi>
Subject: [PATCH 04/12] mkfs.minix: remove unuseful code
Date: Wed, 24 Jun 2015 09:15:11 +0100 [thread overview]
Message-ID: <1435133719-2971-5-git-send-email-kerolasa@iki.fi> (raw)
In-Reply-To: <1435133719-2971-1-git-send-email-kerolasa@iki.fi>
Checks about inodes vs block sizes does not add much robustness. Both
values are derived at compilation time from struct minix_inode size, and
they form full definition circle.
Bad block check for none-block devices should not be supressed, user
requested it so let him have it.
Check for st_rdev == 0x0300 || st_rdev == 0x0340 was unreachable.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
---
disk-utils/mkfs.minix.c | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/disk-utils/mkfs.minix.c b/disk-utils/mkfs.minix.c
index a198e5a..d3b46b2 100644
--- a/disk-utils/mkfs.minix.c
+++ b/disk-utils/mkfs.minix.c
@@ -659,11 +659,6 @@ int main(int argc, char ** argv) {
textdomain(PACKAGE);
atexit(close_stdout);
- if (INODE_SIZE * MINIX_INODES_PER_BLOCK != MINIX_BLOCK_SIZE)
- errx(MKFS_EX_ERROR, _("%s: bad inode size"), device_name);
- if (INODE2_SIZE * MINIX2_INODES_PER_BLOCK != MINIX_BLOCK_SIZE)
- errx(MKFS_EX_ERROR, _("%s: bad inode size"), device_name);
-
while ((i = getopt_long(argc, argv, "1v23n:i:cl:Vh", longopts, NULL)) != -1)
switch (i) {
case '1':
@@ -776,9 +771,7 @@ int main(int argc, char ** argv) {
} else if (!S_ISBLK(statbuf.st_mode)) {
if (!BLOCKS)
BLOCKS = statbuf.st_size / MINIX_BLOCK_SIZE;
- check=0;
- } else if (statbuf.st_rdev == 0x0300 || statbuf.st_rdev == 0x0340)
- errx(MKFS_EX_ERROR, _("will not try to make filesystem on '%s'"), device_name);
+ }
if (BLOCKS < 10)
errx(MKFS_EX_ERROR, _("%s: number of blocks too small"), device_name);
--
2.4.4
next prev parent reply other threads:[~2015-06-24 8:15 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-24 8:15 [PATCH 00/12] pull: minix updates Sami Kerola
2015-06-24 8:15 ` [PATCH 01/12] mkfs.minix: increase maximum minix v2 and v3 file system sizes Sami Kerola
2015-06-24 8:15 ` [PATCH 02/12] mkfs.minix: introduce long options to the command Sami Kerola
2015-06-24 8:15 ` [PATCH 03/12] mkfs.minix: use is_mounted() from libcommon Sami Kerola
2015-06-24 8:15 ` Sami Kerola [this message]
2015-06-24 8:15 ` [PATCH 05/12] mkfs.minix: add fs_control structure, and remove most global variables Sami Kerola
2015-06-24 8:15 ` [PATCH 06/12] mkfs.minix: check user input carefully Sami Kerola
2015-06-24 8:15 ` [PATCH 07/12] mkfs.minix: check requested blocks will not exceed available on device Sami Kerola
2015-06-24 8:15 ` [PATCH 08/12] mkfs.minix: refactor root block content creation Sami Kerola
2015-06-24 8:15 ` [PATCH 09/12] fsck.minix: rename device file descriptor variable Sami Kerola
2015-06-24 8:15 ` [PATCH 10/12] fsck.minix: add minix v3 support Sami Kerola
2015-06-24 8:15 ` [PATCH 11/12] fsck.minix: introduce long options to the command Sami Kerola
2015-06-24 8:15 ` [PATCH 12/12] docs: make fsck.minix(8) more pretty Sami Kerola
2015-07-30 9:55 ` [PATCH 00/12] pull: minix updates Karel Zak
2015-07-30 10:31 ` Sami Kerola
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1435133719-2971-5-git-send-email-kerolasa@iki.fi \
--to=kerolasa@iki.fi \
--cc=util-linux@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox