From patchwork Thu Sep 20 06:33:43 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tao Ma X-Patchwork-Id: 185315 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 1E1972C0099 for ; Thu, 20 Sep 2012 16:33:58 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751129Ab2ITGd4 (ORCPT ); Thu, 20 Sep 2012 02:33:56 -0400 Received: from oproxy8-pub.bluehost.com ([69.89.22.20]:58164 "HELO oproxy8-pub.bluehost.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1751011Ab2ITGdz (ORCPT ); Thu, 20 Sep 2012 02:33:55 -0400 Received: (qmail 14899 invoked by uid 0); 20 Sep 2012 06:33:55 -0000 Received: from unknown (HELO box585.bluehost.com) (66.147.242.185) by oproxy8.bluehost.com with SMTP; 20 Sep 2012 06:33:55 -0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tao.ma; s=default; h=Message-Id:Date:Subject:To:From; bh=8lwY6YQGbu2TmXjam9RRlzb7h4ebH1grqZAZzO86ry0=; b=h/7PWD8JIt2YS91H3mZxmpbIG+KXtagEN0vSaL/3086JXG8Zz/b2MTo8lgMjozFHOdKiOsbxd/hLmhagwgTxFnqglDSPo5LpdE42jShjRPzNMRqObE3oumTLoeswlpTW; Received: from [42.120.72.160] (port=51344 helo=tma-laptop1.taobao.ali.com) by box585.bluehost.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.76) (envelope-from ) id 1TEaKg-0005Mi-Fs for linux-ext4@vger.kernel.org; Thu, 20 Sep 2012 00:33:55 -0600 From: Tao Ma To: linux-ext4@vger.kernel.org Subject: [PATCH] ext4: Don't calc checksum in update_backups in online resize. Date: Thu, 20 Sep 2012 14:33:43 +0800 Message-Id: <1348122823-4930-1-git-send-email-tm@tao.ma> X-Mailer: git-send-email 1.7.4.1 X-Identified-User: {1390:box585.bluehost.com:colyli:tao.ma} {sentby:smtp auth 42.120.72.160 authed with tm@tao.ma} Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org From: Tao Ma update_backups is used to backup all the metadata blocks, so we should not take it for granted that 'data' is pointed to a super block and use ext4_superblock_csum_set to calculate the checksum there. In case the data is a group descriptor block, it will corrupt the last group descriptor. And e2fsck will complain it. As all the metadata checksum should already be OK when we do the backup, remove the wrong ext4_superblock_csum_set and it should be just fine. Reported-by: "Theodore Ts'o" Signed-off-by: Tao Ma --- fs/ext4/resize.c | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diff --git a/fs/ext4/resize.c b/fs/ext4/resize.c index 41f6ef6..019d528 100644 --- a/fs/ext4/resize.c +++ b/fs/ext4/resize.c @@ -970,8 +970,6 @@ static void update_backups(struct super_block *sb, goto exit_err; } - ext4_superblock_csum_set(sb, (struct ext4_super_block *)data); - while ((group = ext4_list_backups(sb, &three, &five, &seven)) < last) { struct buffer_head *bh;