]> www.infradead.org Git - users/hch/xfstests-dev.git/commitdiff
ceph/001: skip metrics check if no copyfrom mount option is used
authorLuís Henriques <lhenriques@suse.de>
Tue, 24 May 2022 09:42:56 +0000 (10:42 +0100)
committerZorro Lang <zlang@kernel.org>
Tue, 24 May 2022 16:44:02 +0000 (00:44 +0800)
Checking the metrics is only valid if 'copyfrom' mount option is
explicitly set, otherwise the kernel won't be doing any remote object
copies.  Fix the logic to skip this metrics checking if 'copyfrom' isn't
used.

Signed-off-by: Luís Henriques <lhenriques@suse.de>
Reviewed-by: Zorro Lang <zlang@kernel.org>
Signed-off-by: Zorro Lang <zlang@kernel.org>
tests/ceph/001

index 7970ce352babfd2e69133cec57194e576b56914f..060c4c450091f9af2f45e33b4f5d7092b84838c9 100755 (executable)
@@ -86,11 +86,15 @@ check_copyfrom_metrics()
        local copies=$4
        local c1=$(get_copyfrom_total_copies)
        local s1=$(get_copyfrom_total_size)
+       local hascopyfrom=$(_fs_options $TEST_DEV | grep "copyfrom")
        local sum
 
-       if [ ! -d $metrics_dir ]; then
+       if [ ! -d "$metrics_dir" ]; then
                return # skip metrics check if debugfs isn't mounted
        fi
+       if [ -z "$hascopyfrom" ]; then
+               return # ... or if we don't have copyfrom mount option
+       fi
 
        sum=$(($c0+$copies))
        if [ $sum -ne $c1 ]; then