ceph/001: skip metrics check if no copyfrom mount option is used
PATCH v2 1/1 ceph/001: skip metrics check if no copyfrom mount option is used
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.
--- 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.
tests/ceph/001 +5 -1
@@ -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
Quoted 5 lines · 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.
Quoted 8 lines
Signed-off-by Luís Henriques <[email protected]>--- 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.
Good to me,
Quoted 23 lines
tests/ceph/001 +5
-1@@ -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
Quoted 11 lines · Zorro Lang
Quoted 10 lines · 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 <[email protected]>--- tests/ceph/001 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
Quoted 6 lines
Quoted 3 lines
Changes since v1:
- Quoted 'hascopyfrom' variable in 'if' statement; while there, added quotes to the 'if' statement just above.Good to me,
Reviewed-by Zorro Lang <[email protected]>
Ping.
Cheers,
--
Luís
Quoted 24 lines
Quoted 23 lines
tests/ceph/001 +5
-1@@ -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
Quoted 12 lines · Luís Henriques
Quoted 11 lines · Zorro Lang
Quoted 10 lines · 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 <[email protected]>--- tests/ceph/001 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
Changes since v1:
- Quoted 'hascopyfrom' variable in 'if' statement; while there, added quotes to the 'if' statement just above.Good to me,
Reviewed-by Zorro Lang <[email protected]>Ping.
Ok, please ignore my last two emails about 2 missing patches. I was looking at a local stale branch. Sorry for the noise :-(
Cheers,
--
Luís
Quoted 25 lines
Quoted 25 lines
Quoted 24 lines
tests/ceph/001 +5
-1@@ -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