kernelstub icon indicating copy to clipboard operation
kernelstub copied to clipboard

Fix bug in path to UUID code with multi-device btrfs

Open andykitchen opened this issue 6 years ago • 0 comments

This is a rebase of the same patch from #22

This also makes the UUID matching code more robust at the expense of using the external tool `findmnt'

This bug is caused by the assumtion that there is a 1-1 correspondence between device files and UUIDs (which is almost always true). Unfortunately BTRFS multi-device filesystems may have multiple devices associated with a single UUID. The old link reading code does not handle this case and fails to work.

Ultimately it's probably better to use a upstream maintained tool for computing path -> UUID as it is subtle and not a core problem this tool is trying to solve. Also, findmnt' is already provided by the util-linux' package so another package dependency is not added.

andykitchen avatar Oct 16 '19 05:10 andykitchen