Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754157AbbKBVFO (ORCPT ); Mon, 2 Nov 2015 16:05:14 -0500 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:13909 "EHLO mx0b-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753647AbbKBVFI (ORCPT ); Mon, 2 Nov 2015 16:05:08 -0500 Date: Mon, 2 Nov 2015 16:03:47 -0500 From: Chris Mason To: "J. Bruce Fields" CC: Neil Brown , Al Viro , Christoph Hellwig , Linux btrfs Developers List , Linux FS-devel Mailing List , LKML Subject: Re: [PATCH/RFC] make btrfs subvol mounts appear in /proc/mounts Message-ID: <20151102210347.GA20170@ret.masoncoding.com> Mail-Followup-To: Chris Mason , "J. Bruce Fields" , Neil Brown , Al Viro , Christoph Hellwig , Linux btrfs Developers List , Linux FS-devel Mailing List , LKML References: <87oafkc5kp.fsf@notabene.neil.brown.name> <20151102205012.GA26986@fieldses.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20151102205012.GA26986@fieldses.org> User-Agent: Mutt/1.5.23.1 (2014-03-12) X-Originating-IP: [192.168.52.123] X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2015-11-02_12:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2011 Lines: 42 On Mon, Nov 02, 2015 at 03:50:12PM -0500, J. Bruce Fields wrote: > On Wed, Oct 28, 2015 at 07:25:10AM +0900, Neil Brown wrote: > > > > If you create a subvolume in btrfs and access it (by name) without > > mounting it, then the subvolume looks like a separate mount to some > > extent, returning a different st_dev to stat(), but it doesn't look like > > a separate mount in that it isn't listed in /proc/mounts. This > > inconsistency can confuse tools. > > > > This patch causes these subvolumes to become separate mounts by using > > the VFS' automount functionality, much like NFS uses automount when it > > discovered mountpoints on the server. > > > > The VFS currently makes it impossible to auto-mount a directory on to itself > > (i.e. a bind mount). For NFS this isn't a problem as a new superblock > > is created for the child filesystem so there are two separate dentries > > (and inodes) for the one directory: one in the parent filesystem, one in > > the child (note that the two superblocks share a common connection to > > the server so there is still a lot of commonality). > > > > BTRFS has chosen instead to use a single superblock for all subvolumes. > > Naive question: was there a reason for that choice? They are really all part of the same FS, the single super better fits. Or said another way, it felt like there would be dramatically more duct tape around supers-per-subvolume than there was abusing st_dev. Neil's patch came up after I told him a few of us had tried to do the same thing and failed to find clean vfs changes to make it possible...he took it as a challenge. Now I have to remember what it was about our past attempts that I didn't like. I'll test this and queue for 4.5 if it all works out, thanks Neil! -chris -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/