From patchwork Wed May 3 08:02:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Wagner X-Patchwork-Id: 13229792 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 5DAD2C7EE2D for ; Wed, 3 May 2023 08:03:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229721AbjECIDS (ORCPT ); Wed, 3 May 2023 04:03:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58896 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229638AbjECIDO (ORCPT ); Wed, 3 May 2023 04:03:14 -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 6AB37E74; Wed, 3 May 2023 01:03:13 -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 24D9D2233B; Wed, 3 May 2023 08:03:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1683100992; 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=blxJG8cSb9nAOdVRY3eSjODYe9Zj/GUTrxASYKRPMLY=; b=bqoL0PAsnBVoBT+vIpTrr9Jset9nzF3lrBJXsVMbuSoNhTG2zu6/wtaluV7O2LU2DutVGG Z9v54fs4JRFGFQmHGwyaMDvWYnvoTpU5kBfvkFUgS/BKHxPUb6Z0o4PS8oW1YWJFBDe3hx TM2dAwYZQVVesKKsft+iGmk7pS+MWxg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1683100992; 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=blxJG8cSb9nAOdVRY3eSjODYe9Zj/GUTrxASYKRPMLY=; b=8KqA9O/ZNgmjUTpiONgED2mK5EzNsj5MZmjAK3nxMQFj4gGQ9Hl/a/HixnskEhFE4P+HAW 63To15r+HFiOQ7BQ== 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 1696A1331F; Wed, 3 May 2023 08:03:12 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 8VA0BUAVUmQzYgAAMHmgww (envelope-from ); Wed, 03 May 2023 08:03:12 +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 v3 04/12] common/xfs: Limit fio size job to fit into xfs fs Date: Wed, 3 May 2023 10:02:50 +0200 Message-Id: <20230503080258.14525-5-dwagner@suse.de> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230503080258.14525-1-dwagner@suse.de> References: <20230503080258.14525-1-dwagner@suse.de> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org The usable capacity of the filesystem is less than the raw partition/device size due to the additional meta/log data. Ensure that the job size for fio is not exceeding the limits. Because we have hard coded the path where we mount the filesystem and don't want to expose this, we just update max size inside _xfs_run_fio_verify_io(). No need to leak this into the caller. Signed-off-by: Daniel Wagner --- common/xfs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/xfs b/common/xfs index 413c2820ffaf..37ce85878df2 100644 --- a/common/xfs +++ b/common/xfs @@ -37,6 +37,9 @@ _xfs_run_fio_verify_io() { sz_mb="${avail_mb}" else sz_mb="$(convert_to_mb "${sz}")" + if [[ "${sz_mb}" -gt "${avail_mb}" ]]; then + sz_mb="${avail_mb}" + fi fi _run_fio_verify_io --size="${sz_mb}m" --directory="${mount_dir}/"