From patchwork Mon Nov 22 02:21:38 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Kent X-Patchwork-Id: 346761 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oAM2LmWn032369 for ; Mon, 22 Nov 2010 02:21:49 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756242Ab0KVCVo (ORCPT ); Sun, 21 Nov 2010 21:21:44 -0500 Received: from out1.smtp.messagingengine.com ([66.111.4.25]:42358 "EHLO out1.smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756054Ab0KVCVo (ORCPT ); Sun, 21 Nov 2010 21:21:44 -0500 Received: from compute2.internal (compute2.nyi.mail.srv.osa [10.202.2.42]) by gateway1.messagingengine.com (Postfix) with ESMTP id B7E45413; Sun, 21 Nov 2010 21:21:43 -0500 (EST) Received: from frontend2.messagingengine.com ([10.202.2.161]) by compute2.internal (MEProxy); Sun, 21 Nov 2010 21:21:43 -0500 X-Sasl-enc: MerrRuuQM+kSkYkijBq/RuTblAyzdCs8wVv8GhJZmc/q 1290392502 Received: from [10.49.97.31] (203-59-115-235.dyn.iinet.net.au [203.59.115.235]) by mail.messagingengine.com (Postfix) with ESMTPSA id D2D835E3603; Sun, 21 Nov 2010 21:21:41 -0500 (EST) Subject: Re: [PATCH] Btrfs: setup blank root and fs_info for mount time From: Ian Kent To: Josef Bacik Cc: linux-btrfs@vger.kernel.org In-Reply-To: <1290196755-19607-1-git-send-email-josef@redhat.com> References: <1290196755-19607-1-git-send-email-josef@redhat.com> Date: Mon, 22 Nov 2010 10:21:38 +0800 Message-ID: <1290392498.2602.21.camel@perseus.themaw.net> Mime-Version: 1.0 X-Mailer: Evolution 2.32.0 (2.32.0-2.fc14) Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Mon, 22 Nov 2010 02:22:02 +0000 (UTC) diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index 6b57da3..960b320 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c @@ -565,6 +565,12 @@ static int btrfs_test_super(struct super_block *s, void *data) struct btrfs_fs_devices *test_fs_devices = data->fs_info->fs_devices; struct btrfs_root *root = btrfs_sb(s); + /* + * If this super block is going away, return false as it + * can't match as an existing super block. + */ + if (!atomic_read(&s->s_active)) + return 0; return root->fs_info->fs_devices == test_fs_devices; }