From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BCD2EC433EF for ; Tue, 7 Jun 2022 14:32:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232816AbiFGOca (ORCPT ); Tue, 7 Jun 2022 10:32:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229884AbiFGOc3 (ORCPT ); Tue, 7 Jun 2022 10:32:29 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F32A57B21; Tue, 7 Jun 2022 07:32:27 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 6289921991; Tue, 7 Jun 2022 14:32:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1654612346; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=I4emLTCIsOQsiQS0phw/LVM6r2iPjLA2WL2vfK3Okgc=; b=E9TxjCFBZdV2BVBIF6D95zFm9Zb/Da+937+F6ZEbdVCC6GzIWCiLyQNHFUrCFQcjIWBtBy HKcsvJp5D9CX7mYLAM7LOkpPt9GP5/r/Mdh+uxWK0pe/gxRgIAHiRW2SzGwsxQsTs0ezXR sBaG20HeCcsLucuiRfOl0HGVsT9U8a0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1654612346; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=I4emLTCIsOQsiQS0phw/LVM6r2iPjLA2WL2vfK3Okgc=; b=EsZNWx+JME1QsiG9JX1SSyEN50NZPIPren46ppPh3CDgA+oPdu+5e5DJskZiLf7EFQ9aso QRp4ElJIrR2Y8eCA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 1C6B913638; Tue, 7 Jun 2022 14:32:26 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id /NGOA3phn2L+RwAAMHmgww (envelope-from ); Tue, 07 Jun 2022 14:32:26 +0000 Received: from localhost (brahms.olymp [local]) by brahms.olymp (OpenSMTPD) with ESMTPA id fff50aa0; Tue, 7 Jun 2022 14:33:07 +0000 (UTC) Date: Tue, 7 Jun 2022 15:33:07 +0100 From: =?iso-8859-1?Q?Lu=EDs?= Henriques To: Zorro Lang Cc: fstests@vger.kernel.org, ceph-devel@vger.kernel.org Subject: Re: [PATCH v2] ceph/001: skip metrics check if no copyfrom mount option is used Message-ID: References: <20220524094256.16746-1-lhenriques@suse.de> <20220524165926.dkighy46hi75mg6s@zlang-mailbox> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20220524165926.dkighy46hi75mg6s@zlang-mailbox> Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org 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 > > --- > > 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 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 > > >