From patchwork Mon Dec 14 19:18:38 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 67333 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nBEJIiZ6028909 for ; Mon, 14 Dec 2009 19:18:44 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932464AbZLNTSo (ORCPT ); Mon, 14 Dec 2009 14:18:44 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932458AbZLNTSo (ORCPT ); Mon, 14 Dec 2009 14:18:44 -0500 Received: from mx1.redhat.com ([209.132.183.28]:51405 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932454AbZLNTSn (ORCPT ); Mon, 14 Dec 2009 14:18:43 -0500 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nBEJId2c031458 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 14 Dec 2009 14:18:39 -0500 Received: from localhost.localdomain (vpn-10-190.rdu.redhat.com [10.11.10.190]) by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id nBEJIcRw030766; Mon, 14 Dec 2009 14:18:39 -0500 Date: Mon, 14 Dec 2009 14:18:38 -0500 From: Josef Bacik To: linux-btrfs@vger.kernel.org Cc: chris.mason@oracle.com Subject: [PATCH] Btrfs: make subvol=0 mount the original default root Message-ID: <20091214191838.GC2165@localhost.localdomain> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.19 (2009-01-05) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.17 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index bcbdc1b..ccc0380 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c @@ -305,9 +305,15 @@ static int btrfs_parse_early_options(const char *options, fmode_t flags, switch (token) { case Opt_subvol: intarg = 0; - match_int(&args[0], &intarg); - if (intarg) - *subvol_objectid = intarg; + error = match_int(&args[0], &intarg); + if (!error) { + /* we want the original fs_tree */ + if (!intarg) + *subvol_objectid = + BTRFS_FS_TREE_OBJECTID; + else + *subvol_objectid = intarg; + } break; case Opt_device: error = btrfs_scan_one_device(match_strdup(&args[0]),