[Btrfs-devel] [PATCH 0/2] make root directory writeable

Chris Mason chris.mason at oracle.com
Fri Jun 29 05:35:40 PDT 2007


On Fri, Jun 29, 2007 at 08:28:21AM -0400, Josef Bacik wrote:
> On Fri, Jun 29, 2007 at 08:05:37AM -0400, Chris Mason wrote:
> > On Thu, Jun 28, 2007 at 11:36:59PM -0400, Josef Bacik wrote:
> > > Hello,
> > > 
> > > Not really sure why but when you do a mkfs it creates a default directory and
> > > the root directory is read-only.  The first patch makes the root directory
> > > writeable, and the second patch fixes mkfs so it sets the root directoryy's
> > > permission properly and doesn't create the default directory.  I tested this on
> > > my box and ran iozone and it worked fine.  Thank you,
> > 
> > Thanks for sending these along, but the top level directory is special.
> > It is meant to only have snapshots and subvolumes.  As we refine the way
> > that subvolumes and snapshots are presented, the top level directory
> > won't be needed anymore (at least won't need to be visible), but for
> > right now, it does need to be read only.
> > 
> > The 'default' directory is a subvolume, where all the tree blocks and
> > file extents inside are reference counted.  You can make more subvolumes
> > appear in the root directory with the btrfsctl command:
> > 
> > btrfsctl -s new_subvol mount_point
> > 
> > The btree that makes up the root directory is written via copy-on-write,
> > but it is not reference counted.  It is a special index of the
> > subvolumes and snapshots on the FS, so we don't want to create files
> > there.
> >
> 
> Ahh ok, I couldn't see any explanation as to why you did it that way so I
> figured it was just to make it easier to show off snapshots/subvolumes early on.
> Thanks for the explanation.

It would have helped if I had more comments or something in the code ;)
Sorry about that.

-chris




More information about the Btrfs-devel mailing list