diff options
author | Nitesh Shetty <nj.shetty@samsung.com> | 2022-03-23 23:36:43 +0530 |
---|---|---|
committer | Eryu Guan <guaneryu@gmail.com> | 2022-04-10 23:15:49 +0800 |
commit | 513338e6a74342d5614c7a27b278f0195e42a12f (patch) | |
tree | 7e04e2458454dda1b5003a2fb21c7f1b9d28db1c | |
parent | 52fe88c9f545f24670b12133e3941a9e0bafb929 (diff) | |
download | xfstests-dev-513338e6a74342d5614c7a27b278f0195e42a12f.tar.gz |
generic/108: use blockdev utility to calculate physical and logical block size
Reading sysfs to get physical and logical block fails,
if SCRATCH_DEV is partitioned device.
Signed-off-by: Nitesh Shetty <nj.shetty@samsung.com>
Reported-by: Darrick J. Wong <djwong@kernel.org>
Reported-by: Wang Yugui <wangyugui@e16-tech.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
-rwxr-xr-x | tests/generic/108 | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/generic/108 b/tests/generic/108 index db0e9bd057..efe66ba57f 100755 --- a/tests/generic/108 +++ b/tests/generic/108 @@ -42,8 +42,8 @@ _require_non_zoned_device $SCRATCH_DEV lvname=lv_$seq vgname=vg_$seq -physical=$(cat /sys/block/$(_short_dev $SCRATCH_DEV)/queue/physical_block_size) -logical=$(cat /sys/block/$(_short_dev $SCRATCH_DEV)/queue/logical_block_size) +physical=`blockdev --getpbsz $SCRATCH_DEV` +logical=`blockdev --getss $SCRATCH_DEV` # _get_scsi_debug_dev returns a scsi debug device with 128M in size by default SCSI_DEBUG_DEV=`_get_scsi_debug_dev ${physical:-512} ${logical:-512} 0 300` |