Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp8877858rwr; Thu, 11 May 2023 07:19:07 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6vAUt9H9ScD8szfr6CJ8yuCfZ2SccNTcqPxjA3DNedI85x4GRu67+Sd/4F0WfR/wBpQJ4+ X-Received: by 2002:a05:6a20:8e29:b0:103:b0f9:7110 with SMTP id y41-20020a056a208e2900b00103b0f97110mr4381398pzj.11.1683814747455; Thu, 11 May 2023 07:19:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683814747; cv=none; d=google.com; s=arc-20160816; b=ndDRJniRqDLBDV5DvHSJmNHN86Z5nQI3cYDCOS8mP5CK/VGPZg6MmecegvQpNUHtZB QO5gYeS0iaRMoz3qxLbzypoEMWzn1FGab9TCSwhc3JuXl/64C8Vaq0sdQuLu2yUdM/Xi NoidslmEp7hnvABCT78tOIfpfeoFv1nc25Z8HDSbgM+9xB66jaW3wIbfHiM9hrUs+Erb 8fDSOmKXHN7+fjB4CRn9ggS1PZ+Vr8mG0z2Yo0eD+JbpUVK+/3yyGDIE0LWB8i8VtNtL H79XsGAKyCBqDZber0ndlW3OIPB0IqC9GvmKIIvGhq0oKi6wRR7ylqtfvEMQ377dQ87N +MJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=MPFdoG7uuwmTENcS5c7mzPwTN+daQlG3WR9cD+OuVis=; b=EhqGSeMKDSimpqQr7ygzx1CehQfOGp/pbtw3mKv1J+wgYJM5XFjrnMpirFUDR3UHUF SVKd74q62SE1tVqGFZ39fp70sHucBqoU4JNnKm2RrflwD+bc/RvJniDAX8OfAALwXiF6 5eyBsmVuPaettwrrXfKl5vvnmaHws8wFWOvKWHak60w30+2ji6paV204Dz3BoU1GTz5v Kjgx48WWgCUU20IhH7jAtfYlq7MMrMKXmMEvmy9cNdUQMhUfjZPeM0z4y3sLMSf/VZHO HPgtpouKJQtDKecNWivVDi6fO/G5g1eVGkck68GoyKEClym65flh/aIXX603Oi1rW4jR dojQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=toY1DqJ8; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z28-20020a63b91c000000b0051b631334f1si7051313pge.764.2023.05.11.07.18.55; Thu, 11 May 2023 07:19:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=toY1DqJ8; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238079AbjEKOKT (ORCPT + 99 others); Thu, 11 May 2023 10:10:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53814 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238321AbjEKOKJ (ORCPT ); Thu, 11 May 2023 10:10:09 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CE02D5B97; Thu, 11 May 2023 07:10:06 -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-out2.suse.de (Postfix) with ESMTPS id 1630E1FF01; Thu, 11 May 2023 14:10:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1683814205; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MPFdoG7uuwmTENcS5c7mzPwTN+daQlG3WR9cD+OuVis=; b=toY1DqJ8OXiUnTuxMprmlb768/WiFuR8Fgv5JorerOUXMJLXNygO2QJ4KRuvO5NFCd69xA 3gxYFL4BjiB9gTiA5VMaibe6tVJLyVwLEq4bCIWfqoi++a/Q5rHkcMmTYOh3kDPca8IKr6 gxK8K1zprtA7TFDW36FJkryuWbQaN/8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1683814205; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MPFdoG7uuwmTENcS5c7mzPwTN+daQlG3WR9cD+OuVis=; b=edArzHalbYJ0YCWUqXQHPzrXCYAjuGpVO8zS1Uat+b/rOjI1ekAWmiDJS2is5JWals7Ro1 BpysYciPXR0ReeCw== 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 B9618134B2; Thu, 11 May 2023 14:10:04 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id MGSDJDz3XGRgPwAAMHmgww (envelope-from ); Thu, 11 May 2023 14:10:04 +0000 From: Daniel Wagner To: linux-nvme@lists.infradead.org Cc: linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, Chaitanya Kulkarni , Shin'ichiro Kawasaki , Hannes Reinecke , Daniel Wagner Subject: [PATCH blktests v4 03/11] common/xfs: Make size argument optional for _xfs_run_fio_verify_io Date: Thu, 11 May 2023 16:09:45 +0200 Message-Id: <20230511140953.17609-4-dwagner@suse.de> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230511140953.17609-1-dwagner@suse.de> References: <20230511140953.17609-1-dwagner@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Make the size argument optional by reading the filesystem info. The caller doesn't have to guess (or calculate) how big the max IO size. The log data structure of XFS is reducing the capacity. Reviewed-by: Chaitanya Kulkarni Signed-off-by: Daniel Wagner --- common/xfs | 14 +++++++++++++- tests/nvme/012 | 2 +- tests/nvme/013 | 2 +- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/common/xfs b/common/xfs index 2c5d96164ac1..413c2820ffaf 100644 --- a/common/xfs +++ b/common/xfs @@ -24,10 +24,22 @@ _xfs_run_fio_verify_io() { local mount_dir="/mnt/blktests" local bdev=$1 local sz=$2 + local sz_mb + local avail + local avail_mb _xfs_mkfs_and_mount "${bdev}" "${mount_dir}" >> "${FULL}" 2>&1 - _run_fio_verify_io --size="$sz" --directory="${mount_dir}/" + avail="$(df --output=avail "${mount_dir}" | tail -1)" + avail_mb="$((avail / 1024))" + + if [[ -z "${sz}" ]]; then + sz_mb="${avail_mb}" + else + sz_mb="$(convert_to_mb "${sz}")" + fi + + _run_fio_verify_io --size="${sz_mb}m" --directory="${mount_dir}/" umount "${mount_dir}" >> "${FULL}" 2>&1 rm -fr "${mount_dir}" diff --git a/tests/nvme/012 b/tests/nvme/012 index e60082c2e751..c9d24388306d 100755 --- a/tests/nvme/012 +++ b/tests/nvme/012 @@ -44,7 +44,7 @@ test() { cat "/sys/block/${nvmedev}n1/uuid" cat "/sys/block/${nvmedev}n1/wwid" - _xfs_run_fio_verify_io "/dev/${nvmedev}n1" "900m" + _xfs_run_fio_verify_io "/dev/${nvmedev}n1" _nvme_disconnect_subsys "${subsys_name}" diff --git a/tests/nvme/013 b/tests/nvme/013 index 9d60a7df4577..265b6968fd34 100755 --- a/tests/nvme/013 +++ b/tests/nvme/013 @@ -41,7 +41,7 @@ test() { cat "/sys/block/${nvmedev}n1/uuid" cat "/sys/block/${nvmedev}n1/wwid" - _xfs_run_fio_verify_io "/dev/${nvmedev}n1" "900m" + _xfs_run_fio_verify_io "/dev/${nvmedev}n1" _nvme_disconnect_subsys "${subsys_name}" -- 2.40.0