ureadahead ignores all btrfs mountpoints

Bug #570014 reported by John Dong
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ureadahead (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

Binary package hint: ureadahead

ureadahead relies on stat()'ing files in order to retrieve the major/minor of a given filesystem, which is then looked up against /proc/self/mountinfo. However, this does not work in btrfs, as the major/minor numbers in /proc/self/mountinfo do not correspond to the ones gotten from the stat() earlier.

e.g. On my system, which has btrfs root on top of LVM2, on top of dm-crypt:
stat() of any file in / results in: 0:17.
ls -l of /dev/mapper reveals /dev/mapper/cryptostuff-root: 252:1
/proc/self/mountinfo says / is mounted on device 0:16.

The same applies for my /home, which has a similar setup.

A related bug is bug #450260. However, the fix used there cannot apply to this bug as well, as ureadahead uses the major/minor for different purposes from Grub.

Somewhat related is that ureadahead cannot detect the rotationalness of the underlying device, due to its reliance on stat()'ing to get the major/minor numbers. However, it falls back on rotational=true, which is the same behaviour as filesystems on virtual devices, e.g. dm-crypt/LVM.

Changed in ureadahead (Ubuntu):
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
Chow Loong Jin (hyperair) wrote :

I've just fixed (or maybe just worked around, depending on how you see it) this issue by making btrfs compare the devno of the stat()'d file with the devno stat()'d from each mount point found in /proc/self/mountinfo. Attached is a patch, please do what you wish with it as you see fit. The patched ureadahead package can be found in my PPA (https://launchpad.net/~hyperair/+archive/ppa) for testing.

description: updated
Revision history for this message
Colin Watson (cjwatson) wrote :

This looks right to me, on the principle of comparing like against like. I'm sponsoring this for maverick. (Scott might want to review this himself once he's back from leave, of course.)

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ureadahead - 0.100.0-5

---------------
ureadahead (0.100.0-5) maverick; urgency=low

  * src/pack.c: Amend mount point detection logic to stat the mount point
    instead of just comparing major/minor versions with /proc/self/mountinfo
    (LP: #570014).
 -- Chow Loong Jin <email address hidden> Fri, 25 Jun 2010 13:14:54 +0100

Changed in ureadahead (Ubuntu):
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.