From patchwork Wed Apr 3 13:51:39 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukas Czerner X-Patchwork-Id: 233472 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id C59F52C00A7 for ; Thu, 4 Apr 2013 00:51:44 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757245Ab3DCNvo (ORCPT ); Wed, 3 Apr 2013 09:51:44 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54880 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756992Ab3DCNvo (ORCPT ); Wed, 3 Apr 2013 09:51:44 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r33Dph4s023925 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 3 Apr 2013 09:51:43 -0400 Received: from localhost.localdomain.com (vpn1-5-173.ams2.redhat.com [10.36.5.173]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r33Dpgkv016397; Wed, 3 Apr 2013 09:51:42 -0400 From: Lukas Czerner To: linux-ext4@vger.kernel.org Cc: Lukas Czerner Subject: [PATCH] mke2fs: Disallow bigalloc with with bs < 4096 Date: Wed, 3 Apr 2013 15:51:39 +0200 Message-Id: <1364997099-22590-1-git-send-email-lczerner@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Currently there is nothing preventing user to create file system with bigalloc feature enabled and block size smaller than 4096 Bytes. However such combination does not make much sense at all because the whole point of bigalloc is to have bigger allocation units. This patch disallow such combination. Thanks! -Lukas --- misc/mke2fs.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/misc/mke2fs.c b/misc/mke2fs.c index bbf477a..1f33a20 100644 --- a/misc/mke2fs.c +++ b/misc/mke2fs.c @@ -1924,6 +1924,12 @@ profile_error: "smaller than the block size.\n")); exit(1); } + if (EXT2_BLOCK_SIZE(&fs_param) < 4096) { + com_err(program_name, 0, + _("Bigalloc feature is not supported with " + "block size smaller than 4096 B")); + exit(1); + } } else if (cluster_size) { com_err(program_name, 0, _("specifying a cluster size requires the "