Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp1216802rwr; Thu, 20 Apr 2023 11:33:03 -0700 (PDT) X-Google-Smtp-Source: AKy350Yi6lcJZefr8G7Q/GawhKGuXs3vLe6DyRLROoZn2S3jJAiIoz9fyHnCakj3ZJzd1Bb/icHX X-Received: by 2002:a05:6a20:c91c:b0:ef:1457:6ce9 with SMTP id gx28-20020a056a20c91c00b000ef14576ce9mr2520536pzb.54.1682015583474; Thu, 20 Apr 2023 11:33:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682015583; cv=none; d=google.com; s=arc-20160816; b=FNWfNoWz+SgbrE1wJFmC/fxRtVM5Jex/Yq3oN3jZuxLHxfPReV+5hoDr+Ys40nbXum pUGNOEYKvR17IyfI84LFNlQPzpxWy+33SY5P6VQYUw83jOPDoo4QnfZ4FKd9wZEhno7i sUiSVbLOTXFmfCkgY1pQkA8Kf+mcsf/HPECjZlLDDg+PFbdyY/PGoHyx55TdyCYktOCy er6hSL2kqc7QAHyKQIwa6iTyK8DnjzJz6wIYNF05EWszAeXODdajcESH1V2YK4RJs8Oj DBJrTw3nRX+ruOhwOeRWu2jLy23JyGvk+QWzkwJZDNQ/+N8EUXF0zafpwEVXRsrD3WVV fjfA== 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=Piq20gmCbu/sfasT+BJykUx1CpQBqc0w9RDrikSeIvU=; b=A5p+zYd8NQuIDbKkwm1BUFx3s5fvRTpAQucrpK1NarQdJ+aXUlb2s2p2xHrLRJY5CB kXUClJx1Zr3m3L6z2FduvSIuKA/i+czCUPS4qmDDH4G3aRdY8sGnhCUR4pzc8qEY40MG kYVZpTG2gcdWB+rswYlFeb+fA6A9KnP6DwzC0FZNkfuRfZyUKUwv0+GUoWxVMtZDbAqi OV4/Eti5BgOe+USSRJJG6b2gVh6czESii9bMqQEkgUrlyorWeWOsXSrgOWjBEyy7jZlt Hgg/iDBqp7oC/48M1PF8OUKLaLY7QeqC5SSyzDSILcJTer/ur8wN7chKaOrczA/64bt3 k8nw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=FqlAaB7V; dkim=neutral (no key) header.i=@suse.de; 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 4-20020a630004000000b0050beec91e30si2173780pga.768.2023.04.20.11.32.51; Thu, 20 Apr 2023 11:33:03 -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=FqlAaB7V; dkim=neutral (no key) header.i=@suse.de; 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 S231660AbjDTSbj (ORCPT + 99 others); Thu, 20 Apr 2023 14:31:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41844 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231137AbjDTSb3 (ORCPT ); Thu, 20 Apr 2023 14:31:29 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5494930E3; Thu, 20 Apr 2023 11:31:28 -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 E212B2197E; Thu, 20 Apr 2023 18:31:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1682015486; 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=Piq20gmCbu/sfasT+BJykUx1CpQBqc0w9RDrikSeIvU=; b=FqlAaB7VQf937XJ4IqGhpNSFSf9GkwmOUmwjwLXKVuyPN33waFQzqIb6giB1RLQNmAncYu FQ4+nhoKkYpk2yDVHCXhmOfPLW8bZ3gAudBZuyqQcK0EoiLBPbC2JMWeGE9eohNvotrwcF KtsnOtDjILUgDRZCxh87EhxNUwBfz0w= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1682015486; 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=Piq20gmCbu/sfasT+BJykUx1CpQBqc0w9RDrikSeIvU=; b=ajRf4HRB9pmqcBDtcDAwVAA2xALAvOT7YK/t98otENHzD1fch2kAnSyNLhlwfoQuA9s1SM Vl4npiaPmgIlK7Ag== 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 D3BAA13584; Thu, 20 Apr 2023 18:31:26 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 4ZacM/6EQWSrNAAAMHmgww (envelope-from ); Thu, 20 Apr 2023 18:31:26 +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 , Daniel Wagner Subject: [PATCH blktests v2 3/9] common-xfs: Make size argument optional for _xfs_run_fio_verify_io Date: Thu, 20 Apr 2023 20:31:13 +0200 Message-Id: <20230420183121.4489-5-dwagner@suse.de> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230420183121.4489-1-dwagner@suse.de> References: <20230420183121.4489-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. Signed-off-by: Daniel Wagner --- common/xfs | 6 ++++++ tests/nvme/012 | 2 +- tests/nvme/013 | 2 +- tests/nvme/035 | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/common/xfs b/common/xfs index 2c5d96164ac1..ec35599e017b 100644 --- a/common/xfs +++ b/common/xfs @@ -27,6 +27,12 @@ _xfs_run_fio_verify_io() { _xfs_mkfs_and_mount "${bdev}" "${mount_dir}" >> "${FULL}" 2>&1 + if [[ -z "${sz}" ]]; then + local avail + avail="$(df --output=avail "${mount_dir}" | awk 'NR==2 {print $1}')" + sz="$(printf "%d" $((avail / 1024 - 1 )))m" + fi + _run_fio_verify_io --size="$sz" --directory="${mount_dir}/" umount "${mount_dir}" >> "${FULL}" 2>&1 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}" diff --git a/tests/nvme/035 b/tests/nvme/035 index eb1024edddbf..8b485bc8e682 100755 --- a/tests/nvme/035 +++ b/tests/nvme/035 @@ -32,7 +32,7 @@ test_device() { port=$(_nvmet_passthru_target_setup "${subsys}") nsdev=$(_nvmet_passthru_target_connect "${nvme_trtype}" "${subsys}") - _xfs_run_fio_verify_io "${nsdev}" "900m" + _xfs_run_fio_verify_io "${nsdev}" _nvme_disconnect_subsys "${subsys}" _nvmet_passthru_target_cleanup "${port}" "${subsys}" -- 2.40.0