linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Artem Blagodarenko <artem.blagodarenko@gmail.com>
To: linux-ext4@vger.kernel.org
Cc: adilger.kernel@dilger.ca, Alexey Lyashkov <alexey.lyashkov@gmail.com>
Subject: [PATCH] mke2fs: avoid inode number error with large FS
Date: Mon, 12 Feb 2018 14:14:19 +0300	[thread overview]
Message-ID: <20180212111419.25036-1-artem.blagodarenko@gmail.com> (raw)

From: Alexey Lyashkov <alexey.lyashkov@gmail.com>

Sometimes during system deployment customers are faced with system
formating problem for given inodes/bytes rate. User need to recalucate
this rate and start formating again.

This patch adds code that limit inodes count instead of error return,
to use all inodes in the filesystem.

Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-9501
Cray-bug-id: LUS-5250
Signed-off-by: Artem Blagodarenko <artem.blagodarenko@gmail.com>
Signed-off-by: Alexey Lyashkov <alexey.lyashkov@gmail.com>
---
 misc/mke2fs.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/misc/mke2fs.c b/misc/mke2fs.c
index cfb10bc4..6fb0a717 100644
--- a/misc/mke2fs.c
+++ b/misc/mke2fs.c
@@ -2457,14 +2457,11 @@ profile_error:
 		unsigned long long n;
 		n = ext2fs_blocks_count(&fs_param) * blocksize / inode_ratio;
 		if (n > MAX_32_NUM) {
-			if (ext2fs_has_feature_64bit(&fs_param))
-				num_inodes = MAX_32_NUM;
-			else {
+			num_inodes = MAX_32_NUM;
+			if (!ext2fs_has_feature_64bit(&fs_param))
 				com_err(program_name, 0,
-					_("too many inodes (%llu), raise "
-					  "inode ratio?"), n);
-				exit(1);
-			}
+					_("too many inodes (%llu), reduced to "
+					  "%llu"), n, MAX_32_NUM);
 		}
 	} else if (num_inodes > MAX_32_NUM) {
 		com_err(program_name, 0,
-- 
2.14.3 (Apple Git-98)

             reply	other threads:[~2018-02-12 11:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-12 11:14 Artem Blagodarenko [this message]
2018-02-12 15:45 ` [PATCH] mke2fs: avoid inode number error with large FS Lukas Czerner
2018-02-12 16:06   ` Eric Sandeen
2018-02-12 16:23     ` Eric Sandeen
2018-02-12 16:31     ` Lukas Czerner

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=20180212111419.25036-1-artem.blagodarenko@gmail.com \
    --to=artem.blagodarenko@gmail.com \
    --cc=adilger.kernel@dilger.ca \
    --cc=alexey.lyashkov@gmail.com \
    --cc=linux-ext4@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;
as well as URLs for NNTP newsgroup(s).