Re: [PATCH] btrfs/237: adjust uuid heuristics

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]



On 12/02/2022 02:19, Luis Chamberlain wrote:
> 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.
> 
> Cc: Karel Zak <kzak@xxxxxxxxxx>
> Cc: Pankaj Raghav <p.raghav@xxxxxxxxxxx>
> Reported-by: Pankaj Raghav <p.raghav@xxxxxxxxxxx>
> Signed-off-by: Luis Chamberlain <mcgrof@xxxxxxxxxx>

Thanks!
Minior nit below, otherwise
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@xxxxxxx>


> ---
>  tests/btrfs/237 | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/btrfs/237 b/tests/btrfs/237
> index 5168777e..07c07e8e 100755
> --- a/tests/btrfs/237
> +++ b/tests/btrfs/237
> @@ -41,7 +41,14 @@ zonesize=$((zonesize << 9))
>  _scratch_mkfs >/dev/null 2>&1
>  _scratch_mount -o commit=1 # 1s commit time to speed up test
>  
> -uuid=$(findmnt -n -o UUID "$SCRATCH_MNT")
> +uuid=$($BTRFS_UTIL_PROG filesystem show $SCRATCH_DEV |grep uuid: |\
> +        awk '{print $NF}')

Think that should be $AWK_PROG





[Index of Archives]     [Linux Filesystems Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux