]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commit
btrfs/237: adjust uuid heuristics
authorLuis Chamberlain <mcgrof@kernel.org>
Tue, 15 Feb 2022 01:48:43 +0000 (17:48 -0800)
committerEryu Guan <guaneryu@gmail.com>
Sun, 20 Feb 2022 16:43:07 +0000 (00:43 +0800)
commit115096a405bc82ca6c8b46c2c08ee1f7e77eb4b1
tree139be6d031fdf6751236ede096af8724e1b5d077
parentd01e8f25f31dd34c9c296099cf5dd35f13bb29e1
btrfs/237: adjust uuid heuristics

Using $(findmnt -n -o UUID mount-directory) only works on
util-linux v2.38, not on 2.37. Even debian-testing has util-linux
v2.37, so use a mechanism which has worked for longer to fetch the
UUID.

Without this the test fails on permission failure on accessing
the file /sys/fs/btrfs/"$uuid"/bg_reclaim_threshold as $uuid is
empty. So while at it, add a check to ensure the UUID is never
empty.

Use $AWK_PROG in case the preferred awk program is not the
preferred awk program.

Cc: Karel Zak <kzak@redhat.com>
Cc: Pankaj Raghav <p.raghav@samsung.com>
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Tested-by: Adam Manzanares <a.manzanares@samsung.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
tests/btrfs/237