From e57024a3058801af69660cae2028972690554b3f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Lu=C3=ADs=20Henriques?= Date: Tue, 24 May 2022 10:42:56 +0100 Subject: [PATCH] ceph/001: skip metrics check if no copyfrom mount option is used MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Zorro Lang Signed-off-by: Zorro Lang --- tests/ceph/001 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/ceph/001 b/tests/ceph/001 index 7970ce352..060c4c450 100755 --- a/tests/ceph/001 +++ b/tests/ceph/001 @@ -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 -- 2.49.0