Bug 2036976

Summary: create_options ignored for mkfs.btrfs
Product: [Fedora] Fedora Reporter: mb+fedora
Component: python-blivetAssignee: Vojtech Trefny <vtrefny>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: unspecified    
Version: 40CC: blivet-maint-list, dlehman, exnihilo, japokorn, mkolman, rvykydal, vponcova, vtrefny
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: python-blivet-3.11.0-1.fc41 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2024-09-24 00:16:23 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:
Embargoed:

Description mb+fedora 2022-01-04 14:41:30 UTC
Description of problem: can't use --mkfsoptions in ks.cfg for btrfs volumes 

Version-Release number of selected component (if applicable):
anaconda 36.12-1.fc36

How reproducible: always

Steps to Reproduce:
1. include the following in a ks.cfg file
  ## Disk partitioning information
  part btrfs.01 --grow --fstype="btrfs" --ondisk=vda --size=1500 
  btrfs / --name=root --label=ptest --mkfsoptions="--csum xxhash" btrfs.01
2. run the installer
3. look at the btrfs superblock using "btrfs inspect-internal dump-super"

Actual results: crc32c

Expected results: xxhash

Additional info: as discussed in #anaconda with vtrefny

Comment 1 Vojtech Trefny 2022-01-04 15:16:26 UTC
Reproducer without Anaconda:

```
In [1]: import blivet; b=blivet.Blivet(); b.reset()
In [2]: sdb1 = b.devicetree.get_device_by_name("sdb1")
In [3]: b.format_device(sdb1, blivet.formats.get_format("btrfs"))
In [4]: vol = b.new_btrfs(parents=[sdb1], create_options="--csum xxhash")
In [5]: b.create_device(vol)
In [6]: b.do_it()
```

neither passing the create_options directly to BTRFSVolumeDevice nor to the format with fmt_args={"create_options": "--csum xxhash"}) work with "new_btrfs" -- the mkfs options are not passed to the bd_btrfs_create_volume function from blivet.

Comment 2 Ben Cotton 2022-02-08 21:17:16 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 36 development cycle.
Changing version to 36.

Comment 3 mb+fedora 2022-04-07 20:16:02 UTC
If this bug can be fixed for F36 that'd be wonderful, but I suspect that ship has now sailed, so I might change it back to rawhide. I don't know how long the bug has been there, certainly at least a couple of years so maybe always.

Comment 4 Ben Cotton 2022-08-09 13:37:56 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 37 development cycle.
Changing version to 37.

Comment 5 mb+fedora 2022-11-27 10:12:02 UTC
This bug persists in Fedora 37.

Comment 6 Ben Cotton 2023-02-07 15:10:07 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 38 development cycle.
Changing version to 38.

Comment 7 mb+fedora 2024-02-22 10:00:15 UTC
Looks like this bug is still present in F40. I'd love to see it fixed, especially if (I can hope..) btrfs might make a re-appearance in RHEL10.

Comment 8 Vojtech Trefny 2024-04-11 13:06:43 UTC
*** Bug 2274375 has been marked as a duplicate of this bug. ***

Comment 9 Vojtech Trefny 2024-07-18 14:47:29 UTC
upstream PR: https://github.com/storaged-project/blivet/pull/1260

updates image for rawhide (41): https://vtrefny.fedorapeople.org/img/rhbz2036976.img

Comment 10 Fedora Update System 2024-09-20 12:57:23 UTC
FEDORA-2024-8173c55024 (python-blivet-3.11.0-1.fc41) has been submitted as an update to Fedora 41.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-8173c55024

Comment 11 Fedora Update System 2024-09-21 03:02:23 UTC
FEDORA-2024-8173c55024 has been pushed to the Fedora 41 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2024-8173c55024`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2024-8173c55024

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 12 Fedora Update System 2024-09-24 00:16:23 UTC
FEDORA-2024-8173c55024 (python-blivet-3.11.0-1.fc41) has been pushed to the Fedora 41 stable repository.
If problem still persists, please make note of it in this bug report.