From patchwork Fri Aug 5 04:27:51 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Dong X-Patchwork-Id: 108605 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 3AF94B6F77 for ; Fri, 5 Aug 2011 14:28:10 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750766Ab1HEE2H (ORCPT ); Fri, 5 Aug 2011 00:28:07 -0400 Received: from mail-yw0-f46.google.com ([209.85.213.46]:50570 "EHLO mail-yw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750838Ab1HEE2E (ORCPT ); Fri, 5 Aug 2011 00:28:04 -0400 Received: by ywn13 with SMTP id 13so1476293ywn.19 for ; Thu, 04 Aug 2011 21:28:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=W3sKZ71AIotFzOEwD9FAF3HvmpcWD7PrN/0We079p8w=; b=FO6NISJdZzE97ya/hxr4ix4XHLo+f43pG0QmN4KZ4jaP+2Bt1jL198ohwkyVXHAzBl rpZqK8Tg+iiBJZ8SKshrAiWDgDzUxfM/cQd2duWrf7vtjq4B/H7oP2eUcBS4pjUQ35d2 NVei+UFD3AtTa7mt0HiNsu6RS71cz0v2hJ7Nk= Received: by 10.142.203.10 with SMTP id a10mr1610860wfg.51.1312518483160; Thu, 04 Aug 2011 21:28:03 -0700 (PDT) Received: from localhost.localdomain ([110.75.120.247]) by mx.google.com with ESMTPS id g4sm2887729pbj.9.2011.08.04.21.28.01 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 04 Aug 2011 21:28:02 -0700 (PDT) From: Robin Dong To: linux-ext4@vger.kernel.org Cc: Robin Dong Subject: [PATCH 2/2 bigalloc] e2fsprogs: use s_log_block_size to decide s_first_data_block in ext2fs_initialize Date: Fri, 5 Aug 2011 12:27:51 +0800 Message-Id: <1312518471-30714-2-git-send-email-hao.bigrat@gmail.com> X-Mailer: git-send-email 1.7.3.2 In-Reply-To: <1312518471-30714-1-git-send-email-hao.bigrat@gmail.com> References: <1312518471-30714-1-git-send-email-hao.bigrat@gmail.com> Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org From: Robin Dong After mke2fs with 1024 block size: #misc/mke2fs -m 0 -O ^resize_inode,extent,meta_bg,bigalloc -b 1024 /dev/sda kernel reports: [74687.352702] EXT4-fs (loop0): ext4_check_descriptors: Inode bitmap for group 0 not in group (block 524288)! [74687.355534] EXT4-fs (loop0): group descriptors corrupted! when mount /dev/sda. The reason is mke2fs set s_first_data_block to 0 by mistake just because s_log_cluster_size is 4 when s_log_block_size==0. This patch is based on "next" branch of e2fsprogs. Signed-off-by: Robin Dong --- lib/ext2fs/initialize.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/lib/ext2fs/initialize.c b/lib/ext2fs/initialize.c index ccc2dee..c2344a0 100644 --- a/lib/ext2fs/initialize.c +++ b/lib/ext2fs/initialize.c @@ -155,7 +155,7 @@ errcode_t ext2fs_initialize(const char *name, int flags, } else super->s_log_cluster_size = super->s_log_block_size; - set_field(s_first_data_block, super->s_log_cluster_size ? 0 : 1); + set_field(s_first_data_block, super->s_log_block_size ? 0 : 1); set_field(s_max_mnt_count, 0); set_field(s_errors, EXT2_ERRORS_DEFAULT); set_field(s_feature_compat, 0);