From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pd0-f175.google.com ([209.85.192.175]:36628 "EHLO mail-pd0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752217AbbEKVPd (ORCPT ); Mon, 11 May 2015 17:15:33 -0400 Received: by pdea3 with SMTP id a3so157262170pde.3 for ; Mon, 11 May 2015 14:15:32 -0700 (PDT) Date: Mon, 11 May 2015 14:15:31 -0700 From: Omar Sandoval To: dsterba@suse.cz, Chris Mason , Josef Bacik , linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org, Qu Wenruo Subject: Re: [PATCH v2 5/6] Btrfs: unify subvol= and subvolid= mounting Message-ID: <20150511211531.GA10078@mew.dhcp4.washington.edu> References: <074cb88847c0034aa1fc28f78f69c3dd1d5bd938.1428614837.git.osandov@osandov.com> <20150511153724.GO23255@twin.jikos.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <20150511153724.GO23255@twin.jikos.cz> Sender: linux-btrfs-owner@vger.kernel.org List-ID: On Mon, May 11, 2015 at 05:37:24PM +0200, David Sterba wrote: > On Thu, Apr 09, 2015 at 02:34:55PM -0700, Omar Sandoval wrote: > > @@ -1321,7 +1438,7 @@ static struct dentry *btrfs_mount(struct file_system_type *fs_type, int flags, > > return ERR_PTR(error); > > } > > > > - if (subvol_name) { > > + if (subvol_name || subvol_objectid != BTRFS_FS_TREE_OBJECTID) { > > /* mount_subvol() will free subvol_name. */ > > return mount_subvol(subvol_name, subvol_objectid, flags, > > device_name, data); > > The story is that I've used this patchset as a base for my per-subvolume > mount flags because it made the mount path cleaner, so it's possible that > the issue I saw was related to my changes. > > The modified 'if' above did not catch subvol_objectid == 0. I'm not sure > now how it got there, btrfs_parse_early_options recognizes 0 and > switches it to 5. > > My testing script is quite simple and does only > > mount -o compress-force=lzo,subvol=/subv1 $dev mnt > mount -o compress-force=zlib,subvol=/subv2 $dev mnt2 > > after mkfs. The first pass would resolve the path to the subvol root and > replace the options with subvolid=0, calls mount_subvol, vfs_kern_mount > than in turn goes back to btrfs_mount. Unless I'm missing something, > this should also work, because parse_early_options is called again and > does subvolid=0 -> subvol_objectid=5 . Oh well, more debugging needed, > not a blocker for this patchset. Hm, yeah, I don't see how that would happen. Do you have that patchset up anywhere? -- Omar