From patchwork Mon Feb 12 11:14:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Artem Blagodarenko X-Patchwork-Id: 871985 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-ext4-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="MgeCd4Z7"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3zg33Q4dfSz9t34 for ; Mon, 12 Feb 2018 22:14:42 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933581AbeBLLOl (ORCPT ); Mon, 12 Feb 2018 06:14:41 -0500 Received: from mail-it0-f66.google.com ([209.85.214.66]:55592 "EHLO mail-it0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754057AbeBLLOl (ORCPT ); Mon, 12 Feb 2018 06:14:41 -0500 Received: by mail-it0-f66.google.com with SMTP id b66so6193195itd.5 for ; Mon, 12 Feb 2018 03:14:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=HoPeGO9QvqRVPfRBgsZV9QkDXt/Lyv3JMqn0EI/NIzw=; b=MgeCd4Z75QbyZmXvKkzFwQYJWWWZ3zCV5wb0RH6Sj8wLH+XqpAl9jfRbUIBt62wARG wehYWLaINizZkPKjK8tHOMe5sy3pGSMkHrg6qXKdXVFoNJL0gGQ01tVVIZBCCgarav9B xzBgAJSRA+m+aa1ktHulpGIOo/17FL11ULRpkLccKp3O+pBkz/b8lMKxLkHgIxkwHJO7 k0OJju+j5SIXwO+96ATSpvI+AiOcYI/8aJIPs0YVETWZkwOdK0HzuOOMO4icPjrGFfnu //FJve4+N0rCL2HPpmyCDsYzLOywtBECmcyemJYNlJ/Z4prKOHWHfkZhup86Sw1cA/Gd 6OHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=HoPeGO9QvqRVPfRBgsZV9QkDXt/Lyv3JMqn0EI/NIzw=; b=arT52j675VW3utsI9KBSmfswdgRNIBj4SyHETJRPbdgkBZTan75HcGgOGZowN+X4il 1zKIMOgW1dVlOd3rFLZLK/YCCHKTzrF6t5d2Yr5lOi9ifR4Wd7HKt0giIlfEGJt+YZJq slWzoDh4+9U77skq2WtUfqi+MkGwuReIlImP2Hf4lVhco5lI4Uwly4zNCbGEM4waGAAV aF0DHkb3eCgbaXi5o2JF+onEk81ojONudnPJUj0OveiV9SDQf1ZmTpozIxuv15P14qKu +EBp41xrFfYCQ6Zc/GOlYXXIazmVfhJQnlugsJIJJ4Q40Vxt+y5CjQuV7I5qmqRXYTdZ ddRQ== X-Gm-Message-State: APf1xPACTP4PL+GDdezNsAthNuBnn071Z4YI1IZ1XemyJM1K8+D8hKqn O/LAwtbTAjDlnykljjsvmNBfTA== X-Google-Smtp-Source: AH8x227QiuPwVYOTXTaIvXVDamwFKaFxXBt9VQAcLCI3xu2FC22eOtgeKH4edwDLkieWXis6MrY+Hw== X-Received: by 10.36.0.23 with SMTP id 23mr5099965ita.53.1518434080294; Mon, 12 Feb 2018 03:14:40 -0800 (PST) Received: from C02TN4C6HTD6.us.cray.com (chippewa-nat.cray.com. [136.162.34.1]) by smtp.gmail.com with ESMTPSA id w133sm7249079itc.44.2018.02.12.03.14.37 (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 12 Feb 2018 03:14:39 -0800 (PST) From: Artem Blagodarenko To: linux-ext4@vger.kernel.org Cc: adilger.kernel@dilger.ca, Alexey Lyashkov Subject: [PATCH] mke2fs: avoid inode number error with large FS Date: Mon, 12 Feb 2018 14:14:19 +0300 Message-Id: <20180212111419.25036-1-artem.blagodarenko@gmail.com> X-Mailer: git-send-email 2.14.3 (Apple Git-98) Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org From: Alexey Lyashkov 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 Signed-off-by: Alexey Lyashkov --- 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,