From patchwork Fri Oct 4 02:45:06 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: jon ernst X-Patchwork-Id: 280453 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 5CCAB2C00CC for ; Fri, 4 Oct 2013 12:45:09 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753712Ab3JDCpI (ORCPT ); Thu, 3 Oct 2013 22:45:08 -0400 Received: from mail-oa0-f50.google.com ([209.85.219.50]:40456 "EHLO mail-oa0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752248Ab3JDCpH (ORCPT ); Thu, 3 Oct 2013 22:45:07 -0400 Received: by mail-oa0-f50.google.com with SMTP id j1so3320155oag.9 for ; Thu, 03 Oct 2013 19:45:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=XQeZEvNYZKuqAhsxTuu6Os3dJTP7yD8yrsErB/1G42I=; b=qhk1UZh5nmm9AbIy33bTzlFWSBYcrVB3qtI1JCN25xVBjs8/VgbR/rExw6qzFcycJ1 grZBo4+rH6+BkNYTryKJAq3TZI4oU8/lQD43jk6iFZ5HujQPf+KWYFsafr0hGAsABeh6 FsfLzn2WOTBeHSBJOzbOPDGQJFi6gYQVAnTqFkIJFlA4x40ruMaFFp8D8Xi3JjhI/Fio DP/kCQG629uJi0K5W1EsiIXIub7dLJazjQVisLWBsQhz6YGo6VkoAYqxEeTL8QSVhbY3 VPPOpfrvjsb0V2YQRRiuXlmXpEbKwjjdTTwXIJ8Af/QaUsC9z0DSUVvtiMLIjgx3QPKp +tLA== MIME-Version: 1.0 X-Received: by 10.60.52.81 with SMTP id r17mr18006974oeo.3.1380854706975; Thu, 03 Oct 2013 19:45:06 -0700 (PDT) Received: by 10.76.198.165 with HTTP; Thu, 3 Oct 2013 19:45:06 -0700 (PDT) Date: Thu, 3 Oct 2013 22:45:06 -0400 Message-ID: Subject: ext4_wait_block_bitmap() and ext4_read_block_bitmap_nowait() handle bitmap verification differently From: jon ernst To: "linux-ext4@vger.kernel.org List" Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Hi, I found that ext4_wait_block_bitmap() and ext4_read_block_bitmap_nowait() handle bitmap verification differently. wait_block_bitmap() calls ext4_validate_block_bitmap() all the time. But read_block_bitmap_nowait() checks EXT4_BG_BLOCK_UNINIT, if it meets, it will skip ext4_validate_block_bitmap() In my opinion, they'd better do same thing. In that way, we can also return "fail" in ext4_valid_block_bitmap() method when we meet FLEX_BG. @@ -472,8 +472,12 @@ int ext4_wait_block_bitmap(struct super_block *sb, ext4_group_t block_group, return 1; } clear_buffer_new(bh); - /* Panic or remount fs read-only if block bitmap is invalid */ - ext4_validate_block_bitmap(sb, desc, block_group, bh); + + if (desc->bg_flags & cpu_to_le16(EXT4_BG_BLOCK_UNINIT)) { + return 0; + } + /* Panic or remount fs read-only if block bitmap is invalid */ + ext4_validate_block_bitmap(sb, desc, block_group, bh); /* ...but check for error just in case errors=continue. */ return !buffer_verified(bh); } --- To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/fs/ext4/balloc.c b/fs/ext4/balloc.c index dc5d572..366807a 100644 --- a/fs/ext4/balloc.c +++ b/fs/ext4/balloc.c @@ -319,7 +319,7 @@ static ext4_fsblk_t ext4_valid_block_bitmap(struct super_block *sb, * or it has to also read the block group where the bitmaps * are located to verify they are set. */ - return 0; + return 1; } group_first_block = ext4_group_first_block_no(sb, block_group);