diff mbox series

[v2] ceph/001: skip metrics check if no copyfrom mount option is used

Message ID 20220524094256.16746-1-lhenriques@suse.de (mailing list archive)
State New, archived
Headers show
Series [v2] ceph/001: skip metrics check if no copyfrom mount option is used | expand

Commit Message

Luis Henriques May 24, 2022, 9:42 a.m. UTC
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.

Comments

Zorro Lang May 24, 2022, 4:59 p.m. UTC | #1
On Tue, May 24, 2022 at 10:42:56AM +0100, Luís Henriques wrote:
> 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.

Good to me,
Reviewed-by: Zorro Lang <zlang@redhat.com>

> 
> 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
>
Luis Henriques June 7, 2022, 2:33 p.m. UTC | #2
On Wed, May 25, 2022 at 12:59:26AM +0800, Zorro Lang wrote:
> On Tue, May 24, 2022 at 10:42:56AM +0100, Luís Henriques wrote:
> > 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.
> 
> Good to me,
> Reviewed-by: Zorro Lang <zlang@redhat.com>

Ping.

Cheers,
--
Luís


> > 
> > 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
> > 
>
Luis Henriques June 7, 2022, 2:57 p.m. UTC | #3
On Tue, Jun 07, 2022 at 03:33:07PM +0100, Luís Henriques wrote:
> On Wed, May 25, 2022 at 12:59:26AM +0800, Zorro Lang wrote:
> > On Tue, May 24, 2022 at 10:42:56AM +0100, Luís Henriques wrote:
> > > 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.
> > 
> > Good to me,
> > Reviewed-by: Zorro Lang <zlang@redhat.com>
> 
> 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

> 
> > > 
> > > 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
> > > 
> >
diff mbox series

Patch

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