[PATCH 0/2] Allow adding btrfs subvolumes into devicetree outside Anaconda

Anne Mulhern amulhern at redhat.com
Mon Dec 8 18:54:33 UTC 2014





----- Original Message -----
> From: "Vojtěch Trefný" <vtrefny at redhat.com>
> To: anaconda-patches at lists.fedorahosted.org
> Sent: Monday, December 8, 2014 12:25:32 PM
> Subject: Re: [PATCH 0/2] Allow adding btrfs subvolumes into devicetree outside	Anaconda
> 
> 
> Dne 8.12.2014 v 17:40 Anne Mulhern napsal(a):
> >
> >
> >
> > ----- Original Message -----
> >> From: "Vojtech Trefny" <vtrefny at redhat.com>
> >> To: anaconda-patches at lists.fedorahosted.org
> >> Sent: Monday, December 8, 2014 9:24:48 AM
> >> Subject: [PATCH 0/2] Allow adding btrfs subvolumes into devicetree outside
> >> 	Anaconda
> >>
> >> Currently blivet is not recognizing btrfs subvolumes when not in installer
> >> mode. There are two prob
> >> lems:
> >> 1) devices.btrfs.listSubVolumes uses only originalFormat._mountpoint when
> >> looking for subvolumes bu
> >> t for existing btrfs volumes originalFormat._mounpoint is always None and
> >> mountpoint is stored in f
> >> ormat._mountpoint
> > Are you sure that's not the bug to fix? Why is originalFormat._mountpoint
> > always
> > None for existing btrfs volumes?
> 
> It works this way for all (mounted) devices, not only for btrfs so I
> assumed there is a reason for that. Currently devicetree.getActiveMounts
> stores information about mountpoints and mountopts only into format.

It's at least worth checking if that is the bug, right there.

> >
> > Assuming that the originalFormat is the original format, and that format is
> > the
> > planned format of the device,
> Without any actions changing the format, both format and originalFormat
> are the same (except the mountpoint part). After registering an
> ActionDestroyFormat action, originalFormat is replaced by format and
> format is changed to new on

That one difference seems weird to me.

> 
> > it seems weird to do a temporary mount at the
> > planned format's mountpoint, especially in the context in which this method
> > is called.
> But I'm not doing temp mount, I'm talking about devices that are already
> mounted. In installer mode, listSubVolumes will call
> _do_temp_mount(orig=True) to mount the device using originalFormat.

Yeah, sorry, that was a major typo. The reason I was thinking about
_do_temp_mount() is that it has a principled way of deciding which format
it wants, and sticking with that. In your patch (1), assuming that that's
where the bug needs to be fixed, I'ld rather your code did something
similar.



> 
> >
> >> 2) devicetree.populate (or devicetree.handleBTRFSFormat) skips devices
> >> with
> >> existing format -- e.g. already added into devicetree but without
> >> mountpoint
> >> (and without subvolumes):wq
> >>
> >> Vojtech Trefny (2):
> >>    Use format.mountpoint for BTRFS listSubVolumes
> >>    Allow handling device format for already handled BTRFS
> >>
> >>   blivet/devices/btrfs.py | 14 +++++++++-----
> >>   blivet/devicetree.py    |  8 +++++---
> >>   2 files changed, 14 insertions(+), 8 deletions(-)
> >>
> >> --
> >> 2.1.0
> >>
> >> _______________________________________________
> >> anaconda-patches mailing list
> >> anaconda-patches at lists.fedorahosted.org
> >> https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches
> >>
> > Stylistically,
> >
> > a list like [None, "btrfs"]
> >
> > can often be replaced with an equivalent tuple.
> >
> > It's cheaper, and better if you don't actually need
> > any list methods.
> >
> > - mulhern
> > _______________________________________________
> > anaconda-patches mailing list
> > anaconda-patches at lists.fedorahosted.org
> > https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches
> 
> _______________________________________________
> anaconda-patches mailing list
> anaconda-patches at lists.fedorahosted.org
> https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches
> 

- mulhern



More information about the anaconda-patches mailing list