All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] ceph/001: skip metrics check if no copyfrom mount option is used
@ 2022-05-24  9:42 Luís Henriques
  2022-05-24 16:59 ` Zorro Lang
  0 siblings, 1 reply; 4+ messages in thread
From: Luís Henriques @ 2022-05-24  9:42 UTC (permalink / raw)
  To: fstests; +Cc: ceph-devel, Luís Henriques

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>
---
 tests/ceph/001 | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Changes since v1:
- Quoted 'hascopyfrom' variable in 'if' statement; while there, added
  quotes to the 'if' statement just above.

diff --git a/tests/ceph/001 b/tests/ceph/001
index 7970ce352bab..060c4c450091 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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-06-07 14:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-24  9:42 [PATCH v2] ceph/001: skip metrics check if no copyfrom mount option is used Luís Henriques
2022-05-24 16:59 ` Zorro Lang
2022-06-07 14:33   ` Luís Henriques
2022-06-07 14:57     ` Luís Henriques

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.