From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758085Ab2IJQO7 (ORCPT ); Mon, 10 Sep 2012 12:14:59 -0400 Received: from mx2.fusionio.com ([66.114.96.31]:41763 "EHLO mx2.fusionio.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754372Ab2IJQO5 (ORCPT ); Mon, 10 Sep 2012 12:14:57 -0400 X-ASG-Debug-ID: 1347293696-0421b53eae66280001-xx1T2L X-Barracuda-Envelope-From: JBacik@fusionio.com Date: Mon, 10 Sep 2012 12:14:54 -0400 From: Josef Bacik To: Wang Sheng-Hui CC: "Chris L. Mason" , "linux-btrfs@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] btrfs: fix disk-io.c/btrfs_read_dev_super with BTRFS_SUPER_MIRROR_MAX to control the loops Message-ID: <20120910161454.GA2270@localhost.localdomain> X-ASG-Orig-Subj: Re: [PATCH] btrfs: fix disk-io.c/btrfs_read_dev_super with BTRFS_SUPER_MIRROR_MAX to control the loops References: <504D8AEB.9090401@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <504D8AEB.9090401@gmail.com> User-Agent: Mutt/1.5.21 (2011-07-01) X-Barracuda-Connect: mail1.int.fusionio.com[10.101.1.21] X-Barracuda-Start-Time: 1347293696 X-Barracuda-Encrypted: AES128-SHA X-Barracuda-URL: http://10.101.1.181:8000/cgi-mod/mark.cgi X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=9.0 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.108166 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 10, 2012 at 12:38:35AM -0600, Wang Sheng-Hui wrote: > 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; We don't want to do this, it should be left for -o recovery or some such mount option. Thanks, Josef