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 changed:

  Binary package hint: ureadahead
  
- ureadahead relies on stat()'ing mountpoints to retrieve the major/minor
- of a given filesystem. This unfortunately does not work on btrfs (see
- related bug #450260)
+ 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.
  
- As a result, it is unable to find the /sys/dev/block/*/queue/rotational
- file for btrfs devices, leading to an error like:
+ 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.
  
- ureadahead: Unable to obtain rotationalness for device 0:26: No such
- file or directory
+ 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.
  
- and no pack generation for a btrfs filesystem.
+ 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.

** Patch added: "btrfs-fix.debdiff"
   http://launchpadlibrarian.net/50151277/btrfs-fix.debdiff

-- 
ureadahead ignores all btrfs mountpoints
https://bugs.launchpad.net/bugs/570014
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to