From patchwork Wed Feb 12 20:54:43 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luis Chamberlain X-Patchwork-Id: 13972424 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C88E31EEA4A; Wed, 12 Feb 2025 20:54:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739393693; cv=none; b=esK6o33jXQnh+WMt6MkUfopH9OFkwTWHFFXThjDRo/Ok0ZTyzjRHxHOa+PnDXbMXB5o0KR87fmsbSMbzLqftWXASSJOW/td9IwYXivMj+Ggr8pphIW0wAvr/VDUdN9izq19r7hVin3dfjWywV7K8pz0mf2GVBDm5E159rPEEi3g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739393693; c=relaxed/simple; bh=k8dA5lKb2/vo1cUKP/hBBEJjebZ/4e1cGMp4Wi309JQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fvTpZZBsZTCJ5qSxJG6R/0AF2QkfrPER2a2qB/vjuAMJ68Bi/O4BRdMwLykbQi4USBbYagYYiER1HuG2n34+TSzjz/yr0RA6pQJhPRLfnOLCBfnfiyUXlDpWZS9r5hzZXNNkRXcxIp/xQCKWi7X91nXXToPOpE/ZknKxNDC81tw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=OsTi6j38; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="OsTi6j38" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description; bh=LD/vmeHNDlK4DCwLOI57rae7DeHYYbFNDQgh04JcWTA=; b=OsTi6j3878fwSWHjFVZ2AAQJda 2YTNoTkf7xJVB9jaLnqMm42k37B9uxKgLaszcEF1w00FlQjPYxW4R0HCIp7zu4HYQX9GvHNkyg+5M uup8+Xt9NvrgtLtE+Q1qGA43aSj6ijXRd7lnDvRZOVbxnZGsxn4/k2a2bgkmHozs1aihk1FRadicP WXz60HP50+Qkm+jKOy31uQiYgHcrRn0azzzkYNJHzyEZyUQzkykuWsnPjuFO1/DMLH3VF7eUdCW/b jWq5a9ggyZHHp+zRwsk5UceBFLVH6uWASv/ffrb9TgiCGrex10Uyvoz+QWY3hLQogUD3Aja01Z+lb HLAO0Zhg==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.98 #2 (Red Hat Linux)) id 1tiJkw-00000008q87-33ti; Wed, 12 Feb 2025 20:54:50 +0000 From: Luis Chamberlain To: shinichiro.kawasaki@wdc.com Cc: linux-block@vger.kernel.org, hare@suse.de, patches@lists.linux.dev, gost.dev@samsung.com, mcgrof@kernel.org Subject: [PATCH blktests v3 1/6] common/xfs: ignore first umount error on _xfs_mkfs_and_mount() Date: Wed, 12 Feb 2025 12:54:43 -0800 Message-ID: <20250212205448.2107005-2-mcgrof@kernel.org> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250212205448.2107005-1-mcgrof@kernel.org> References: <20250212205448.2107005-1-mcgrof@kernel.org> Precedence: bulk X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Sender: Luis Chamberlain We want to help capture error messages with _xfs_mkfs_and_mount() on $FULL, to do that we should avoid spamming error messages for things which we know are not fatal. Such is the case of when we try to mkfs a filesystem but before that try to umount the target path. The first umount is just for sanity, so ignore the error messages from it. Signed-off-by: Luis Chamberlain --- common/xfs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/xfs b/common/xfs index 569770fecd53..67a3b8a97391 100644 --- a/common/xfs +++ b/common/xfs @@ -15,7 +15,7 @@ _xfs_mkfs_and_mount() { local mount_dir=$2 mkdir -p "${mount_dir}" - umount "${mount_dir}" + umount "${mount_dir}" >/dev/null 2>&1 mkfs.xfs -l size=64m -f "${bdev}" || return $? mount "${bdev}" "${mount_dir}" } From patchwork Wed Feb 12 20:54:44 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luis Chamberlain X-Patchwork-Id: 13972429 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C89401FF5EF; Wed, 12 Feb 2025 20:54:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739393693; cv=none; b=SaHoRis9803W8bqXUbwLndLFcwELRhLbNhKGG6gIkVXY+AbuYbvAvKIcSrdtmBWQ4AlLZS1MZKehddgeEW05y35bz3Z+aOTdUc7xbx209VUPDBAhS1nlohVQQPA1A+GV5NN0JPg74bIo/BCCWgk9zi6AuiBuHCngdW96Ua1s5z8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739393693; c=relaxed/simple; bh=vnnpomG+YXAQFsIDsRQmYC2J41959nMdsLJ0AiIvOK4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=MKXEaNPBJSVwGllyuinhHQ60qvkp+nWBVNucooYFl7uO1wacWcQW+dD7JsIcAE1imKAntg5hb8Dd05I30zJ49Rg15zKrcZeSSSkc41RzGm7KxkSiaY+C6sZO2Myl1gTCuvxAzugjCihBsPqGVtO00tvjHGkasYzHRwyNN+Q7RCY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=hILaRTYM; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="hILaRTYM" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description; bh=Rmr0mdJEelj4oy19Vz6V/3LQ9rOmZsbYuW/DdSgmS/A=; b=hILaRTYM6fAdW0sy6Z8lMgnByk piiXiKxtLxs8oTS8MxMMY7nhteVr1L/ZPwC7OdnW0Dbp6d5V/2qCFsamIbIo/gR9zpjNmoHSEvrtw 1Bf867Rd6IwjG7kjlFecUKrWCEpznNmWc3xq/m7vpjHRqkL61dUvNgOnl7zWgHGzqz+loAlahSmof z6K543+VK1H+fZ7yqiyLn5lxCtDekjmLYmFa25xfnQUvUKnrd1PmLZNE3duxLQWZTzXmENAy2diS0 EXxZeLQeQKygkNvVGyOjgJeUvcqTjuimwfZjDi4Lx5jXOeHNBb1PBJzAmQVEJvgqYtQBOEKjY8mxH RXLOhEdg==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.98 #2 (Red Hat Linux)) id 1tiJkw-00000008q89-3AyJ; Wed, 12 Feb 2025 20:54:50 +0000 From: Luis Chamberlain To: shinichiro.kawasaki@wdc.com Cc: linux-block@vger.kernel.org, hare@suse.de, patches@lists.linux.dev, gost.dev@samsung.com, mcgrof@kernel.org Subject: [PATCH blktests v3 2/6] block/032: make error messages clearer if mkfs or mount fails Date: Wed, 12 Feb 2025 12:54:44 -0800 Message-ID: <20250212205448.2107005-3-mcgrof@kernel.org> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250212205448.2107005-1-mcgrof@kernel.org> References: <20250212205448.2107005-1-mcgrof@kernel.org> Precedence: bulk X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Sender: Luis Chamberlain If block/032 fails at mkfs we want to know why, so propagate error messages. While at it, enhance the test to also propagate the error return from mount and remove the odd sleep for a udevadm settle as that's the only thing I can think of we need to wait for here. Signed-off-by: Luis Chamberlain --- tests/block/032 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/block/032 b/tests/block/032 index 8975879660d7..fc6d1a51dcad 100755 --- a/tests/block/032 +++ b/tests/block/032 @@ -25,10 +25,10 @@ test() { fi mkdir -p "${TMPDIR}/mnt" - _xfs_mkfs_and_mount "/dev/${SCSI_DEBUG_DEVICES[0]}" "${TMPDIR}/mnt" > /dev/null 2>&1 + _xfs_mkfs_and_mount "/dev/${SCSI_DEBUG_DEVICES[0]}" "${TMPDIR}/mnt" >> $FULL || return $? echo 1 > "/sys/block/${SCSI_DEBUG_DEVICES[0]}/device/delete" - sleep 2 - umount "${TMPDIR}/mnt" + udevadm settle + umount "${TMPDIR}/mnt" || return $? _exit_scsi_debug From patchwork Wed Feb 12 20:54:45 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luis Chamberlain X-Patchwork-Id: 13972428 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1BBF9202F6D; Wed, 12 Feb 2025 20:54:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739393693; cv=none; b=aomBrtIlBgdNci0bM9+IWJBmzUSLD+876fx4qaRketFajBCFeSWItu6PJwK2f5mlgRlCciAiepJ9cRCK7XELo1mB8EgRuHn33SjQADfnR9fGJAnA0Dpms+siqP1LxEisyc9plEJ3anGKUtuvWVE/T1B4APbHoKvpUbki/HW2608= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739393693; c=relaxed/simple; bh=vNyrBlhAY7aE+as81EuSZYJfxhbt6hTp51+TfZTxrv0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kT8BS7jbYpzKw+vvhokPZpE5pay+dyyb/7CY+WQOSZg3XUlDp4v13yy7DdFZv6msoaB8SmDSELuXk/GV8yxWlRhGh9QrwOP4+GF3IYCAfGFE7Z9Ij9LaSJoOKxs6TZMqU9RAMuIjI9P+E9vih/pnng0p8J0nu+mRIL26wqtxKTs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=zXz1uP8V; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="zXz1uP8V" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description; bh=1U2lkyKW2xX7lkjqEgPkciQxlo7QalJXRLwfyNhCxXU=; b=zXz1uP8V7BieUD45lRe/NdsVmg CFW4Wq5Ph8DIrV565NHIlX7dILXk/lCDjY4/QOhglxBb7RvxsqRWuHkHyjgA/jwtbGN9h/zZS1miV dYl4/5z57pjod5pxzwUqSr4Gr0TP/yD9EQD2bnip0Cej6oeCcjQ8uUQSBq9uF1+Tkiol2YFVAh3Ew 6cDrEDYYT5BTPoWTsN8PAc5C6B2Lu5rKEMA1AVyfFcK9R8K/QUspw/4zWYeVH56dkHDKVf8OWWxMO QCXdVW6fzUzlPrcT8RaeMtejdjBq5a+K71FGINyufpIwgmBl9FEqolNUHNwnCLUvv/D2HwWGDyHl6 O6cmefNg==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.98 #2 (Red Hat Linux)) id 1tiJkw-00000008q8B-3IZz; Wed, 12 Feb 2025 20:54:50 +0000 From: Luis Chamberlain To: shinichiro.kawasaki@wdc.com Cc: linux-block@vger.kernel.org, hare@suse.de, patches@lists.linux.dev, gost.dev@samsung.com, mcgrof@kernel.org Subject: [PATCH blktests v3 3/6] common: add and use min io for fio Date: Wed, 12 Feb 2025 12:54:45 -0800 Message-ID: <20250212205448.2107005-4-mcgrof@kernel.org> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250212205448.2107005-1-mcgrof@kernel.org> References: <20250212205448.2107005-1-mcgrof@kernel.org> Precedence: bulk X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Sender: Luis Chamberlain When using fio we should not issue IOs smaller than the device supports. Today a lot of places have in place 4k, but soon we will have devices which support bs > ps. For those devices we should check the minimum supported IO. However, since we also have a min optimal IO, we might as well use that as well. By using this we can also leverage the same lookup with stat whether or not the target file is a block device or a file. Signed-off-by: Luis Chamberlain --- common/fio | 26 ++++++++++++++++++++++++-- common/rc | 24 ++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 2 deletions(-) diff --git a/common/fio b/common/fio index b9ea087fc6c5..d147214f3d16 100644 --- a/common/fio +++ b/common/fio @@ -189,15 +189,37 @@ _run_fio() { return $rc } +_fio_opts_to_min_io() { + local arg path + local -i min_io=4096 + + for arg in "$@"; do + [[ "$arg" =~ ^--filename= || "$arg" =~ --directory= ]] || continue + path="${arg##*=}" + min_io=$(_min_io "$path") + # Keep 4K minimum IO size for historical consistency + ((min_io < 4096)) && min_io=4096 + break + done + + echo "$min_io" +} + # Wrapper around _run_fio used if you need some I/O but don't really care much # about the details _run_fio_rand_io() { - _run_fio --bs=4k --rw=randread --norandommap --numjobs="$(nproc)" \ + local bs + + bs=$(_fio_opts_to_min_io "$@") || return 1 + _run_fio --bs="$bs" --rw=randread --norandommap --numjobs="$(nproc)" \ --name=reads --direct=1 "$@" } _run_fio_verify_io() { - _run_fio --name=verify --rw=randwrite --direct=1 --ioengine=libaio --bs=4k \ + local bs + + bs=$(_fio_opts_to_min_io "$@") || return 1 + _run_fio --name=verify --rw=randwrite --direct=1 --ioengine=libaio --bs="$bs" \ --iodepth=16 --verify=crc32c --verify_state_save=0 "$@" } diff --git a/common/rc b/common/rc index a7e899cfb419..6e7bddc844bf 100644 --- a/common/rc +++ b/common/rc @@ -400,6 +400,30 @@ _test_dev_is_partition() { [[ -n ${TEST_DEV_PART_SYSFS} ]] } +_min_io() { + local path_or_dev=$1 + local min_io=4096 + if [ -z "$path_or_dev" ]; then + echo "path for min_io does not exist" + return 1 + fi + + if [ -c "$path_or_dev" ]; then + if [[ "$path_or_dev" == /dev/ng* ]]; then + path_or_dev="${path_or_dev/ng/nvme}" + fi + fi + + if [ -e "$path_or_dev" ]; then + min_io=$(stat --printf=%o "$path_or_dev") + ((min_io < 4096)) && min_io=4096 + echo "$min_io" + else + echo "Error: '$path_or_dev' does not exist or is not accessible" + return 1 + fi +} + # Return max open zones or max active zones of the test target device. # If the device has both, return smaller value. _test_dev_max_open_active_zones() { From patchwork Wed Feb 12 20:54:46 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luis Chamberlain X-Patchwork-Id: 13972430 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C89CA201018; Wed, 12 Feb 2025 20:54:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739393694; cv=none; b=ZCgvaD0PjP/dNxwu5MLRNhRKuuwdkdBVvPF6a467qobSoQu29szreH+SmrOdDMl2roFkFRZ2uFxPdlln1Lm3jkuWmAx55aOCtBQeXfVGzcf06XKAE5090mMV4s99FimAZBR5X7h5Ef2Xmu1PlJtxdpcDYQAboB6Sy8SoDZT1Btw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739393694; c=relaxed/simple; bh=uhsNxdAPKxHM3UCSDS1WcNl9HCUCQ2aGsyZBD15fNpo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mZPfXRV0Gcja7XEzP9MhYDHBBn3BDZCznYrC6/neIuV2g8uOpBtfFRItixPd596UOwvC7a+TeVLy5JzQDLnaERR2vHlFEQh+qxaett0eMT+tpNQV66gZ3ENelSRWe9KnHoZbptZ5X/5fxeqH8uyz9Z5kfFoqzRNgOVfO2I+5EGw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=PSpeok/e; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="PSpeok/e" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description; bh=1QlAPrdBxVcOCau1Ut5LJRxiWh5btrekG1D4njDcpeM=; b=PSpeok/eqVgLq8bV+wYRftOlSA TKHQsfbF6CtrLy79EAMsLXlHFFJQ+Agv7+poLGsrhdfsOiFAdWfGU+o9/sKBD/V1M4PznBD5EKwJ/ n9S6L8OK9VdydlyQMZaJ6BqbpqrAEWM2akccXOTumcYu/nIgMdtjxqf+yPI5DaHdOWgoDucWBhmCr kvSREIXY1OO57itxklB58IBbAr+7NXHS6Gy7ajwr9bEOygeP2gYjXFA3yXEWd47lVx7VfqyOmYZ/g nzFuM7IaLNYGVPv5GW3v5+n32p8SFhi00n8+DVIDULcXMaX405L3PgLbm2CxiYgtp8IpNMu6C0F4z MEiylaUg==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.98 #2 (Red Hat Linux)) id 1tiJkw-00000008q8D-3PvR; Wed, 12 Feb 2025 20:54:50 +0000 From: Luis Chamberlain To: shinichiro.kawasaki@wdc.com Cc: linux-block@vger.kernel.org, hare@suse.de, patches@lists.linux.dev, gost.dev@samsung.com, mcgrof@kernel.org Subject: [PATCH blktests v3 4/6] common/xfs: use min io for fs blocksize Date: Wed, 12 Feb 2025 12:54:46 -0800 Message-ID: <20250212205448.2107005-5-mcgrof@kernel.org> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250212205448.2107005-1-mcgrof@kernel.org> References: <20250212205448.2107005-1-mcgrof@kernel.org> Precedence: bulk X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Sender: Luis Chamberlain Use the min io for the target block size. Likewise we need to increase the log size if using a bs > 4096. Signed-off-by: Luis Chamberlain --- common/xfs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/common/xfs b/common/xfs index 67a3b8a97391..226fdbd1c83f 100644 --- a/common/xfs +++ b/common/xfs @@ -13,10 +13,18 @@ _have_xfs() { _xfs_mkfs_and_mount() { local bdev=$1 local mount_dir=$2 + local bs + local xfs_logsize="64m" + + bs=$(_min_io "$bdev") + + if [[ $bs -gt 4096 ]]; then + xfs_logsize="128m" + fi mkdir -p "${mount_dir}" umount "${mount_dir}" >/dev/null 2>&1 - mkfs.xfs -l size=64m -f "${bdev}" || return $? + mkfs.xfs -l size=$xfs_logsize -f "${bdev}" -b size="$bs" || return $? mount "${bdev}" "${mount_dir}" } From patchwork Wed Feb 12 20:54:47 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luis Chamberlain X-Patchwork-Id: 13972427 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1BB39202C33; Wed, 12 Feb 2025 20:54:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739393693; cv=none; b=JSmDCsZgafFCNysFE+R2bXF+TXh1t0W4wh66qADEkB9uXJskP8dWxKtDzOer2ivRBZTv+aTf6o6xYlkiUPCVY59ZeR+MMJKv5jyiWQ/4Zv+2+aee6O4M6Y+HY/bY43F5BvYA2C0THUgXa+UJRULrhl1LRlIoDByngeuClqwNUoc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739393693; c=relaxed/simple; bh=adWzKjCFzxNuBVmy6SjaplBwVSgeL5T0CTiWNombh0g=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=aK6mCtQNMFjKCOo3hRqI4DTRdKqsxSf+bWXNORgrUVq/3pBERZi3neroIFyNNCGZLZF586IDUHif+I/LTbd6JK3iGrnh9p0RzvRK/euKutJHFPjBm6D6luZf00gn4aZjtSzIvE9Ge7hViLlOcnDoIBEgx3QYGFAwJtTg8810pYc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=PXYKkZ4k; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="PXYKkZ4k" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description; bh=GTl9k7yAp3U+wqtvYfSngx+82iSSK1W56O6UQmOfBSE=; b=PXYKkZ4kXDkrRglQQ2HhUArvl7 RJnZToAppKUKsYXqt4OwyD0iwfeyvrS6i7MhclTrXpcto2HwFP7dPPF4l88UFRWjm40Q/w6TK4R/9 6U/qCFuZIDPDhXyOgjCa7CkUbNiiqtKrNzu1qawp9ma13Cs5FPI1UrDkuhF89Ov+cp3sgKeM1YkDz SSMwvmVZ3l/YE3VgyFoCftZRQ+orkrNCTE3QO/PRFw8xRSETiQjcoJWIdRCqUi6/cYSGb62wNTvkd F+2EOnyBs+L4JrF2beMlEpth/V4AXWlEQZjkV7bOh1y6UtD0yiFUBJEwaVl/LDIyZWG1fuhBtua/4 /6j+ctdw==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.98 #2 (Red Hat Linux)) id 1tiJkw-00000008q8F-3XES; Wed, 12 Feb 2025 20:54:50 +0000 From: Luis Chamberlain To: shinichiro.kawasaki@wdc.com Cc: linux-block@vger.kernel.org, hare@suse.de, patches@lists.linux.dev, gost.dev@samsung.com, mcgrof@kernel.org Subject: [PATCH blktests v3 5/6] tests: use test device min io to support bs > ps Date: Wed, 12 Feb 2025 12:54:47 -0800 Message-ID: <20250212205448.2107005-6-mcgrof@kernel.org> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250212205448.2107005-1-mcgrof@kernel.org> References: <20250212205448.2107005-1-mcgrof@kernel.org> Precedence: bulk X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Sender: Luis Chamberlain When a block device supports a minimum block size > ps we must ensure we don't issue IOs below what is supported. Just leverage the min optimal IO to also ensure we use the optimal IO as well. Signed-off-by: Luis Chamberlain --- tests/block/003 | 6 +++++- tests/block/007 | 5 ++++- tests/nvme/049 | 15 +++++++++++---- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/tests/block/003 b/tests/block/003 index 2af9b89ec3e5..b0dd1d1fd62b 100755 --- a/tests/block/003 +++ b/tests/block/003 @@ -18,10 +18,14 @@ device_requires() { } test_device() { + local test_dev_bs + + test_dev_bs=$(_min_io "$TEST_DEV") + echo "Running ${TEST_NAME}" FIO_PERF_FIELDS=("trim iops") - _fio_perf --bsrange=4k-4g --rw=randtrim --norandommap --name=discards \ + _fio_perf --bsrange="${test_dev_bs}"-4g --rw=randtrim --norandommap --name=discards \ --filename="$TEST_DEV" --number_ios=200k echo "Test complete" diff --git a/tests/block/007 b/tests/block/007 index 3b68d0deec35..8043a83a565b 100755 --- a/tests/block/007 +++ b/tests/block/007 @@ -31,13 +31,16 @@ cleanup_fallback_device() { } run_fio_job() { + local test_dev_bs + + test_dev_bs=$(_min_io "$TEST_DEV") if _test_dev_is_rotational; then size="32m" else size="1g" fi - _fio_perf --bs=4k --rw=randread --norandommap --name=reads \ + _fio_perf --bs="$test_dev_bs" --rw=randread --norandommap --name=reads \ --filename="$TEST_DEV" --size="$size" --direct=1 \ --ioengine=pvsync2 --hipri="$1" } diff --git a/tests/nvme/049 b/tests/nvme/049 index 88d4fb122988..7304d6604d8f 100755 --- a/tests/nvme/049 +++ b/tests/nvme/049 @@ -19,10 +19,16 @@ test_device() { echo "Running ${TEST_NAME}" local ngdev=${TEST_DEV/nvme/ng} - local common_args=( + local test_dev_bs + local target_size=4096 + local common_args=() + local fio_output + + test_dev_bs=$(_min_io "$ngdev") + common_args=( --size=1M --filename="$ngdev" - --bs=4k + --bs="$test_dev_bs" --rw=randread --numjobs=1 --iodepth=16 @@ -32,10 +38,11 @@ test_device() { --time_based --runtime=2 ) - local fio_output + + ((test_dev_bs > target_size)) && target_size=$test_dev_bs # check security permission - if ! fio_output=$(fio --name=check --size=4k --filename="$ngdev" \ + if ! fio_output=$(fio --name=check --bs="$test_dev_bs" --size="$target_size" --filename="$ngdev" \ --rw=read --ioengine=io_uring_cmd 2>&1) && grep -q -e "Operation not permitted" \ -e "Permission denied" <<< "$fio_output"; then From patchwork Wed Feb 12 20:54:48 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luis Chamberlain X-Patchwork-Id: 13972425 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C8A25201258; Wed, 12 Feb 2025 20:54:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739393693; cv=none; b=pVr5FWT+nUO/FTQVPWIujUPyEO+eOMntzFODlrkIoWRIaXzM8Er2LaCnkWYy58Y+HtdykEX9gu5ZNKg7crInK+Bk0rfKX1wtPgtHX4DCddFkoY5j1O9PySNkJEUjoL/hmlmzc430yPTy87xsIkSTTIGueEiWQUWMBZ/jkU2V4Uo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739393693; c=relaxed/simple; bh=07qFMcDQ8An9Ib21CmoWdYlNhpc43kYAeKCaGsKQusE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=X1+pvxP27AtG6H6AsHsgSrP1Bb4lViJ7zP21mSmCCozbhUJU8dFoRYzeAQh/a1U+pIuEMW2l1WJ/gWxgA65yooIq/vQXSIzkT5Se1LdvlclQsJZWV8kQaEAnSwuU5Ep02GGza8NVaE1V5UAYECgebzCBJms6UvSGuG1TXBYeJ0k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=B84msV45; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="B84msV45" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description; bh=UFWuuTJsuoXbom2W75IczMP+fGuQKORSKlCtAWBXU9w=; b=B84msV45oi2B2MRi8XHgaV3Ddb R9uvQWF6uEsUZKgUdD7hvs/Yqst4pEIurHxeenw94/7VJnokBDWg8Ne55LZ+h1idkDoHjtKzEgf6o MQcsPEIniEkiHWhAuTmJdUKHMLUrga592YqAcBTilaJGxJgsT9QwviQRTVLmXD204K8DJpNw34FaR iZWPtg59yHMbl70SlJWxR/Tny22qNLB6PpUY7j7qxadFYgrLzyZouh+Bl/2/ehkGNgaE+uNA7V+z6 1MVoFc8SyEzPiseDY/+uuzB8ewrYB5GdOknGIMGUsivzTCHYv0xY7Q50U3vBBvQripVxs6965538E XtA4R6XA==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.98 #2 (Red Hat Linux)) id 1tiJkw-00000008q8H-3ebB; Wed, 12 Feb 2025 20:54:50 +0000 From: Luis Chamberlain To: shinichiro.kawasaki@wdc.com Cc: linux-block@vger.kernel.org, hare@suse.de, patches@lists.linux.dev, gost.dev@samsung.com, mcgrof@kernel.org Subject: [PATCH blktests v3 6/6] common/xfs: add _test_dev_suits_xfs() to verify logical block size will work Date: Wed, 12 Feb 2025 12:54:48 -0800 Message-ID: <20250212205448.2107005-7-mcgrof@kernel.org> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250212205448.2107005-1-mcgrof@kernel.org> References: <20250212205448.2107005-1-mcgrof@kernel.org> Precedence: bulk X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Sender: Luis Chamberlain mkfs.xfs will use the sector size exposed by the device, if this is larger than 32k this will fail as the largest sector size on XFS is 32k. Provide a sanity check to ensure we skip creating a filesystem if the sector size is larger than what XFS supports. Suggested-by: Shinichiro Kawasaki Signed-off-by: Luis Chamberlain --- common/xfs | 11 +++++++++++ tests/block/032 | 3 ++- tests/nvme/012 | 1 + tests/nvme/035 | 1 + 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/common/xfs b/common/xfs index 226fdbd1c83f..1342a8e61f0b 100644 --- a/common/xfs +++ b/common/xfs @@ -10,6 +10,17 @@ _have_xfs() { _have_fs xfs && _have_program mkfs.xfs } +_test_dev_suits_xfs() { + local logical_block_size + + logical_block_size=$(_test_dev_queue_get logical_block_size) + if ((logical_block_size > 32768 )); then + SKIP_REASONS+=("sector size ${logical_block_size} is larger than max XFS sector size 32768") + return 1 + fi + return 0 +} + _xfs_mkfs_and_mount() { local bdev=$1 local mount_dir=$2 diff --git a/tests/block/032 b/tests/block/032 index fc6d1a51dcad..74688f7fca6e 100755 --- a/tests/block/032 +++ b/tests/block/032 @@ -15,6 +15,7 @@ QUICK=1 requires() { _have_xfs _have_module scsi_debug + _test_dev_suits_xfs } test() { @@ -25,7 +26,7 @@ test() { fi mkdir -p "${TMPDIR}/mnt" - _xfs_mkfs_and_mount "/dev/${SCSI_DEBUG_DEVICES[0]}" "${TMPDIR}/mnt" >> $FULL || return $? + _xfs_mkfs_and_mount "/dev/${SCSI_DEBUG_DEVICES[0]}" "${TMPDIR}/mnt" >> "$FULL" || return $? echo 1 > "/sys/block/${SCSI_DEBUG_DEVICES[0]}/device/delete" udevadm settle umount "${TMPDIR}/mnt" || return $? diff --git a/tests/nvme/012 b/tests/nvme/012 index f9bbdca911c0..f2727c06c893 100755 --- a/tests/nvme/012 +++ b/tests/nvme/012 @@ -17,6 +17,7 @@ requires() { _have_loop _require_nvme_trtype_is_fabrics _require_nvme_test_img_size 350m + _test_dev_suits_xfs } set_conditions() { diff --git a/tests/nvme/035 b/tests/nvme/035 index 9f84ced53ce6..14aa8c22956b 100755 --- a/tests/nvme/035 +++ b/tests/nvme/035 @@ -14,6 +14,7 @@ requires() { _have_kernel_option NVME_TARGET_PASSTHRU _have_xfs _have_fio + _test_dev_suits_xfs } device_requires() {