From patchwork Mon Sep 10 06:38:35 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wang Sheng-Hui X-Patchwork-Id: 1430011 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id DB9754025E for ; Mon, 10 Sep 2012 06:38:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751597Ab2IJGit (ORCPT ); Mon, 10 Sep 2012 02:38:49 -0400 Received: from mail-ob0-f174.google.com ([209.85.214.174]:47959 "EHLO mail-ob0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750883Ab2IJGis (ORCPT ); Mon, 10 Sep 2012 02:38:48 -0400 Received: by obbuo13 with SMTP id uo13so2419114obb.19 for ; Sun, 09 Sep 2012 23:38:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; bh=BUwzMhqdDlGkIj2GifjaWujtzMgRmSMqp9yOL75wtfI=; b=NIjpT+dJcjutHi412SvcQv3OYOKBqFaKV37ynQvV10RWy0EtLkrnyT+vSE9OqUQqND jFRF/cf8KlAqwfDZpWdR2Gd2LkDD5Mll2XrLNlWmz8K7oLQGlmlWNlDDw5CVWyU0GA5g Tzepbbi+TsObfBI52MY2O28cV0mEp1P29zqO527pGdLgNtRu0gSTAwZD9Lu7QnZhfWwS 77zVh4+wWCnU+JEzh0u4LLULuSYoEC8cV0ue3jVajGbfr5PfTUZ0Xwre0xWBBRWKQHYu JfmMLEfHdExhyioDmlKCGk1S3yaq5cmneCh5JnjvNOttZWdl1VDV5SxVjHi4hQ9Dzlhs SSMg== Received: by 10.182.207.71 with SMTP id lu7mr12669431obc.78.1347259126513; Sun, 09 Sep 2012 23:38:46 -0700 (PDT) Received: from [9.115.120.54] ([202.108.130.138]) by mx.google.com with ESMTPS id k8sm9932146oeh.9.2012.09.09.23.38.43 (version=SSLv3 cipher=OTHER); Sun, 09 Sep 2012 23:38:45 -0700 (PDT) Message-ID: <504D8AEB.9090401@gmail.com> Date: Mon, 10 Sep 2012 14:38:35 +0800 From: Wang Sheng-Hui User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.18) Gecko/20110617 Thunderbird/3.1.11 MIME-Version: 1.0 To: chris.mason@fusionio.com, linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] btrfs: fix disk-io.c/btrfs_read_dev_super with BTRFS_SUPER_MIRROR_MAX to control the loops Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org To check the duplicated super blocks, use BTRFS_SUPER_MIRROR_MAX as the loops limit. Signed-off-by: Wang Sheng-Hui --- fs/btrfs/disk-io.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 22e98e0..a431144 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -2723,7 +2723,7 @@ struct buffer_head *btrfs_read_dev_super(struct block_device *bdev) * So, we need to add a special mount option to scan for * later supers, using BTRFS_SUPER_MIRROR_MAX instead */ - for (i = 0; i < 1; i++) { + for (i = 0; i < BTRFS_SUPER_MIRROR_MAX; i++) { bytenr = btrfs_sb_offset(i); if (bytenr + 4096 >= i_size_read(bdev->bd_inode)) break;