Bug 1320340

Summary: blivet: fix btrfs label and mkfsoption handling
Product: Red Hat Enterprise Linux 7 Reporter: Bryan Wann <bwann>
Component: python-blivetAssignee: Blivet Maintenance Team <blivet-maint-list>
Status: CLOSED WONTFIX QA Contact: Release Test Team <release-test-team>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.2CC: josef
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-12-15 07:40:38 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
Patch for btrfs handling in blivet
none
Anaconda / blivet traceback from btrfs none

Description Bryan Wann 2016-03-22 22:22:55 UTC
Created attachment 1139248 [details]
Patch for btrfs handling in blivet

Description of problem:
When kickstart installing a 7.2 system with a btrfs root partition, Anaconda raises a traceback from blivet with this error:

ValueError: / is not a valid name for this device


Version-Release number of selected component (if applicable):
blivet 0.61.15.37
anaconda 21.48.22.56-1
CentOS 7.2


How reproducible:
Reproducible on every kickstart install with btrfs on root partitioning


Steps to Reproduce:
1. Kickstart install a host with this partitioning scheme:

zerombr

clearpart --all --drives=sda --initlabel
bootloader --location=mbr --append="crashkernel=128M console=tty0 console=ttyS1,57600 pcie_pme=nomsi"
part /boot/efi --label=/boot/efi --fstype efi --size=256 --ondisk=sda
part /boot --label=/boot --fstype ext3 --size=512 --ondisk=sda
part swap --size=2048 --ondisk=sda
part btrfs.01 --size=1 --grow --ondisk=sda
btrfs / --label=/ --mkfsoptions="-l 32K -n 32K" btrfs.01
ignoredisk --only-use=sda

2.
3.

Actual results:
Anaconda starts, attempts to partition disks, throws traceback (see attached anaconda-tb-btrfs) for full stacktrace

anaconda 21.48.22.56-1 exception report
Traceback (most recent call first):
  File "/usr/lib/python2.7/site-packages/blivet/devices/device.py", line 84, in __init__
    raise ValueError("%s is not a valid name for this device" % name)
[...cut...]
ValueError: / is not a valid name for this device

Expected results:

Anaconda succeeds in installing the system, has a working brtfs / when it boots:

[root@sparefullweb20650 ~]# btrfs filesystem show
Label: '/'  uuid: 423aebd5-3c9f-406f-9655-51d44ba3763e
        Total devices 1 FS bytes used 2.32GiB
        devid    1 size 463.01GiB used 5.04GiB path /dev/sda4

Btrfs v3.16.2



Additional info:

Chris Mason authored a patch for blivet that corrects this problem (btrfs-kickstart.diff), I'm submitting it on his behalf. We have been using this in production at Facebook and it seems to do the trick.

His notes from the patch:

======
blivet: fix btrfs label and mkfsoption handling

The btrfs volume class didn't have an override in place for isNameValid(),
so it wasn't able to accept labels with / in them.

Also, the mkfsoptions= arg wasn't being passed all the way down to mkfs.btrfs
======

Comment 1 Bryan Wann 2016-03-22 22:23:42 UTC
Created attachment 1139249 [details]
Anaconda / blivet traceback from btrfs

Comment 3 David Lehman 2016-04-25 18:11:32 UTC
Note: This should be fixed in python-blivet-0.76-1 (commit c0933675).

Comment 5 RHEL Program Management 2020-12-15 07:40:38 UTC
After evaluating this issue, there are no plans to address it further or fix it in an upcoming release.  Therefore, it is being closed.  If plans change such that this issue will be fixed in an upcoming release, then the bug can be reopened.