Bug 839960 - udev and btrfsprogs are shipping a btrfs udev rules file
Summary: udev and btrfsprogs are shipping a btrfs udev rules file
Status: RESOLVED FIXED
: 842934 (view as bug list)
Alias: None
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: Kernel (show other bugs)
Version: 13.1 Milestone 4
Hardware: Other Other
: P5 - None : Normal (vote)
Target Milestone: ---
Assignee: Jeff Mahoney
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-09-12 12:08 UTC by Frederic Crozat
Modified: 2014-03-18 16:00 UTC (History)
3 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Frederic Crozat 2013-09-12 12:08:23 UTC
It looks like both udev and btrfsprogs are shipping their own "btrfs" udev rules. We should probably kill one (I think the udev one is more recent but I'm not a btrfs specialist).
Comment 1 Jeff Mahoney 2013-09-25 17:58:28 UTC
I don't know enough about the udev rules to know which file is right. Does the builtin rule get run when LUKS devices get created too?
Comment 2 Frederic Crozat 2013-09-26 09:34:43 UTC
I'm not a udev expert, but here is the rules :

from udev :
SUBSYSTEM!="block", GOTO="btrfs_end"
ACTION=="remove", GOTO="btrfs_end"
ENV{ID_FS_TYPE}!="btrfs", GOTO="btrfs_end"

# let the kernel know about this btrfs filesystem, and check if it is complete
IMPORT{builtin}="btrfs ready $devnode"

# mark the device as not ready to be used by the system
ENV{ID_BTRFS_READY}=="0", ENV{SYSTEMD_READY}="0"

LABEL="btrfs_end"

That will cause the following code to be run: http://cgit.freedesktop.org/systemd/systemd/tree/src/udev/udev-builtin-btrfs.c 

This means it will be run on if ID_FS_TYPE is set. For LUKS devices, this should be handled by 13-dm-disk.rules with the "IMPORT{builtin}="blkid"" line.

Robert, do you confirm ?
Comment 3 Robert Milasan 2013-09-26 09:47:06 UTC
Yes, the idea of the above rule is that if ID_FS_TYPE is not set to btrfs, the rule is skipped. Like Frederic said, blkid command should run on the device and set a couple of env variable (like ID_FS_TYPE) which udev will use in later rules.

If blkid can't get the ID_FS_TYPE or ID_FS_TYPE is set to something else then btrfs, then obviously nothing will be done.
Comment 4 Jeff Mahoney 2013-09-26 21:19:14 UTC
Ok. I'll disable the udev file in btrfsprogs and we'll treat any bugs in that area as udev bugs moving forward.
Comment 5 Jeff Mahoney 2013-09-26 21:23:20 UTC
Added to filesystems:btrfsprogs and forwarded to Factory as SR 200993.
Comment 6 Bernhard Wiedemann 2013-09-26 22:01:06 UTC
This is an autogenerated message for OBS integration:
This bug (839960) was mentioned in
https://build.opensuse.org/request/show/200993 Factory / btrfsprogs
Comment 7 Goldwyn Rodrigues 2013-10-04 15:32:31 UTC
This bugfix side-effect. While installing the kernel (precisely mkinitrd), you get the following error:

cp: cannot stat ‘/usr/lib/udev/rules.d/80-btrfs.rules’: No such file or directory
Script /lib/mkinitrd/setup/11-btrfs.sh failed!

The filename in /lib/mkinitrd/scripts/setup-btrfs.sh needs to be changed to /usr/lib/udev/rules.d/64-btrfs.rules from /usr/lib/udev/rules.d/80-btrfs.rules
Comment 8 Bernhard Wiedemann 2013-10-09 14:00:17 UTC
This is an autogenerated message for OBS integration:
This bug (839960) was mentioned in
https://build.opensuse.org/request/show/202703 Factory / btrfsprogs
Comment 9 Swamp Workflow Management 2013-11-15 18:08:39 UTC
openSUSE-RU-2013:1700-1: An update that has one recommended fix can now be installed.

Category: recommended (low)
Bug References: 839960
CVE References: 
Sources used:
openSUSE 13.1 (src):    btrfsprogs-0.20-4.14.1
Comment 10 David Sterba 2014-03-18 16:00:48 UTC
*** Bug 842934 has been marked as a duplicate of this bug. ***