This series fixes the following use case:
truncate -s 3g btrfs.img
mkfs.btrfs btrfs.img
btrrfs fi show .img
ERROR: not a valid btrfs filesystem: /root/btrfs.img
As evident this currently produces an error due to libblkid not recognising the
image file as a filesystem. This stems from the fact progs doesn't force the
addition of the image file to libblkid's cache. This series rectifies this.
Patch 1 extends btrfs_scan_devices to take an optional path argument which will
be added to libblkid's cache.
Patch 2 Makes 'btrfs filesystem' Utilizes this btrfs_scan_devices' new
interface if it detects we want to query a filesystem placed on an image file.
Patch 3 Adds simple test case to ensure this works as expected and is not
broken in the future.
Nikolay Borisov (3):
btrfs-progs: Make btrfs_scan_devices take a path
btrfs-progs: Correctly identify fs on image files in "filesystem"
subcommands
btrfs-progs: tests: Test fs on image files is correctly recognised
cmds-device.c | 2 +-
cmds-filesystem.c | 3 +--
disk-io.c | 2 +-
tests/cli-tests/010-fi-show-on-new-file/test.sh | 16 ++++++++++++++++
utils.c | 18 +++++++++++++++---
utils.h | 2 +-
6 files changed, 35 insertions(+), 8 deletions(-)
create mode 100755 tests/cli-tests/010-fi-show-on-new-file/test.sh
--
2.7.4