* [PATCH] generic/108: use blockdev utility to calculate physical and logical block size
[not found] <CGME20220323181155epcas5p4892cb43ae57077d34f56baa848f152ce@epcas5p4.samsung.com>
@ 2022-03-23 18:06 ` Nitesh Shetty
2022-03-24 15:13 ` Darrick J. Wong
0 siblings, 1 reply; 2+ messages in thread
From: Nitesh Shetty @ 2022-03-23 18:06 UTC (permalink / raw)
To: fstests
Cc: nitheshshetty, p.raghav, joshi.k, arnav.dawn, mcgrof,
Nitesh Shetty, Darrick J . Wong, Wang Yugui
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>
---
tests/generic/108 | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/generic/108 b/tests/generic/108
index db0e9bd0..efe66ba5 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`
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] generic/108: use blockdev utility to calculate physical and logical block size
2022-03-23 18:06 ` [PATCH] generic/108: use blockdev utility to calculate physical and logical block size Nitesh Shetty
@ 2022-03-24 15:13 ` Darrick J. Wong
0 siblings, 0 replies; 2+ messages in thread
From: Darrick J. Wong @ 2022-03-24 15:13 UTC (permalink / raw)
To: Nitesh Shetty
Cc: fstests, nitheshshetty, p.raghav, joshi.k, arnav.dawn, mcgrof,
Wang Yugui
On Wed, Mar 23, 2022 at 11:36:43PM +0530, Nitesh Shetty wrote:
> 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>
> ---
> tests/generic/108 | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/tests/generic/108 b/tests/generic/108
> index db0e9bd0..efe66ba5 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`
LGTM
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
--D
>
> # _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`
> --
> 2.25.1
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-03-24 15:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <CGME20220323181155epcas5p4892cb43ae57077d34f56baa848f152ce@epcas5p4.samsung.com>
2022-03-23 18:06 ` [PATCH] generic/108: use blockdev utility to calculate physical and logical block size Nitesh Shetty
2022-03-24 15:13 ` Darrick J. Wong
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox