Skip to contentSkip to conversation

fix and improvement for xfs log size change from new xfsprogs version

PATCH In review Yi Zhang 3 participants 6 messages Nov 2, 2022 – Nov 4, 2022 Block layer

lore
Share & tools
lore

Yi Zhang

author
#0 lore raw

v2 cover fix and improvement for xfs log size change from new xfsprogs version

Hi

The first patch addressed nvme/012 nvme/013 failure which introduced from xfsprogs v5.19.0, the minimun xfs log size change to 64m

The second patch introduced one new function _require_test_dev_size_mb

The third patch add one new parameter to _run_fio_verify_io, this will allow fio I/O size definition to the test case

V2:
Update the new function to _require_test_dev_size_mb and nvme/035 to call it for test dev size checking for the second patch Update the title and description for better reflect the change for the third patch

V1: https://lore.kernel.org/linux-block/[email protected]/

Yi Zhang (3):
common/xfs: set the minimal log size 64m during mkfs.xfs common/rc: add one function _require_test_dev_size_mb nvme/012,013,035: change fio I/O size and move size definition place

 common/rc      | 10 ++++++++++
 common/xfs     |  5 +++--
 tests/nvme/012 |  2 +-
 tests/nvme/013 |  2 +-
 tests/nvme/035 |  6 +++++-
 5 files changed, 20 insertions(+), 5 deletions(-)
Signature · 1 line
2.34.1
author
#1 lore raw

PATCH v2 1/3 common/xfs: set the minimal log size 64m during mkfs.xfs

Update to use the new minimum xfs log size 64MB which introudced from xfsprogs v5.19.0:

$ mkfs.xfs -l size=32m -f /dev/nvme0n1
Log size must be at least 64MB.
Usage: mkfs.xfs
/* blocksize */		[-b size=num]
/* config file */	[-c options=xxx]
/* metadata */		[-m crc=0|1,finobt=0|1,uuid=xxx,rmapbt=0|1,reflink=0|1,
			    inobtcount=0|1,bigtime=0|1]
/* data subvol */	[-d agcount=n,agsize=n,file,name=xxx,size=num,
			    (sunit=value,swidth=value|su=num,sw=num|noalign),
			    sectsize=num
/* force overwrite */	[-f]
/* inode size */	[-i perblock=n|size=num,maxpct=n,attr=0|1|2,
			    projid32bit=0|1,sparse=0|1,nrext64=0|1]
/* no discard */	[-K]
/* log subvol */	[-l agnum=n,internal,size=num,logdev=xxx,version=n
			    sunit=value|su=num,sectsize=num,lazy-count=0|1]
/* label */		[-L label (maximum 12 characters)]
/* naming */		[-n size=num,version=2|ci,ftype=0|1]
/* no-op info only */	[-N]
/* prototype file */	[-p fname]
/* quiet */		[-q]
/* realtime subvol */	[-r extsize=num,size=num,rtdev=xxx]
/* sectorsize */	[-s size=num]
/* version */		[-V]
			devicename
<devicename> is required unless -d name=xxx is given.
<num> is xxx (bytes), xxxs (sectors), xxxb (fs blocks), xxxk (xxx KiB),
      xxxm (xxx MiB), xxxg (xxx GiB), xxxt (xxx TiB) or xxxp (xxx PiB).
<value> is xxx (512 byte blocks).
---
 common/xfs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
common/xfs +1 -1
index 210c924..846a5ef 100644
@@ -16,7 +16,7 @@ _xfs_mkfs_and_mount() {
 
 	mkdir -p "${mount_dir}"
 	umount "${mount_dir}"
-	mkfs.xfs -l size=32m -f "${bdev}"
+	mkfs.xfs -l size=64m -f "${bdev}"
 	mount "${bdev}" "${mount_dir}"
 }
 
Signature · 1 line
2.34.1
author
#2 lore raw

PATCH v2 2/3 common/rc: add one function to check required dev size for TEST_DEV

In reply to Yi Zhang

nvme/035 has minimum TEST_DEV size requirement, add a helper function to check it

---
 common/rc      | 10 ++++++++++
 tests/nvme/035 |  4 ++++
 2 files changed, 14 insertions(+)
common/rc +10 -0
index e490041..7987ac3 100644
@@ -324,6 +324,16 @@ _get_pci_parent_from_blkdev() {
 		tail -2 | head -1
 }
 
+_require_test_dev_size_mb() {
+	local require_sz_mb=$1
+	local test_dev_sz_mb=$(($(blockdev --getsize64 "$TEST_DEV")/1024/1024))
+
+	if (( "$test_dev_sz_mb" < "$require_sz_mb" )); then
+		SKIP_REASONS+=("${TEST_DEV} required at least ${require_sz_mb}m")
+		return 1
+	fi
+}
+
 _require_test_dev_in_hotplug_slot() {
 	local parent
 	parent="$(_get_pci_parent_from_blkdev)"
tests/nvme/035 +4 -0
index ee78a75..e8581ef 100755
@@ -16,6 +16,10 @@ requires() {
 	_have_fio
 }
 
+device_requires() {
+	_require_test_dev_size_mb 1024
+}
+
 test_device() {
 	local subsys="blktests-subsystem-1"
 	local ctrldev
Signature · 1 line
2.34.1
author
#3 lore raw

PATCH v2 3/3 nvme/012,013,035: change fio I/O size and move size definition place

In reply to Yi Zhang

Change fio I/O size of nvme/012,013,035 from 950m to 900m, since recent change increased the xfs log size and it caused fio failure with I/O size 950m.

Also add size parameter to _run_fio_verify_io. This allows to move the fio I/O size definition from common/xfs to the test case, so that device size and fio I/O size are both defined at single place.

---
 common/xfs     | 3 ++-
 tests/nvme/012 | 2 +-
 tests/nvme/013 | 2 +-
 tests/nvme/035 | 2 +-
 4 files changed, 5 insertions(+), 4 deletions(-)
common/xfs +2 -1
index 846a5ef..2c5d961 100644
@@ -23,10 +23,11 @@ _xfs_mkfs_and_mount() {
 _xfs_run_fio_verify_io() {
 	local mount_dir="/mnt/blktests"
 	local bdev=$1
+	local sz=$2
 
 	_xfs_mkfs_and_mount "${bdev}" "${mount_dir}" >> "${FULL}" 2>&1
 
-	_run_fio_verify_io --size=950m --directory="${mount_dir}/"
+	_run_fio_verify_io --size="$sz" --directory="${mount_dir}/"
 
 	umount "${mount_dir}" >> "${FULL}" 2>&1
 	rm -fr "${mount_dir}"
tests/nvme/012 +1 -1
index c9d2438..e60082c 100755
@@ -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"
+	_xfs_run_fio_verify_io "/dev/${nvmedev}n1" "900m"
 
 	_nvme_disconnect_subsys "${subsys_name}"
 
tests/nvme/013 +1 -1
index 265b696..9d60a7d 100755
@@ -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"
+	_xfs_run_fio_verify_io "/dev/${nvmedev}n1" "900m"
 
 	_nvme_disconnect_subsys "${subsys_name}"
 
tests/nvme/035 +1 -1
index e8581ef..d169e35 100755
@@ -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}"
+	_xfs_run_fio_verify_io "${nsdev}" "900m"
 
 	_nvme_disconnect_subsys "${subsys}"
 	_nvmet_passthru_target_cleanup "${port}" "${subsys}"
Signature · 1 line
2.34.1
Reviewed-by on the v2 series
#4 lore raw
In reply to Yi Zhang
Quoted 11 lines · Yi Zhang

Hi

The first patch addressed nvme/012 nvme/013 failure which introduced from xfsprogs v5.19.0, the minimun xfs log size change to 64m

The second patch introduced one new function _require_test_dev_size_mb

The third patch add one new parameter to _run_fio_verify_io, this will allow fio I/O size definition to the test case

Quoted 7 lines

V2:
Update the new function to _require_test_dev_size_mb and nvme/035 to call it for test dev size checking for the second patch Update the title and description for better reflect the change for the third patch

V1: https://lore.kernel.org/linux-block/[email protected]/

overall this looks good to me, I believe you have tested this to confirm the stability of the new size for the testcases,

-ck

#5 lore raw
In reply to Yi Zhang
Quoted 9 lines · Yi Zhang

Hi

The first patch addressed nvme/012 nvme/013 failure which introduced from xfsprogs v5.19.0, the minimun xfs log size change to 64m

The second patch introduced one new function _require_test_dev_size_mb

The third patch add one new parameter to _run_fio_verify_io, this will allow fio I/O size definition to the test case

Have applied the patches. Please note that I took a liberty to do minor edits in the second patch. Thanks!

Signature · 1 line
Shin'ichiro Kawasaki