From: "Darrick J. Wong" <djwong@kernel.org>
To: Nitesh Shetty <nj.shetty@samsung.com>
Cc: fstests@vger.kernel.org, nitheshshetty@gmail.com,
p.raghav@samsung.com, joshi.k@samsung.com,
arnav.dawn@samsung.com, mcgrof@kernel.org,
Wang Yugui <wangyugui@e16-tech.com>
Subject: Re: [PATCH] generic/108: use blockdev utility to calculate physical and logical block size
Date: Thu, 24 Mar 2022 08:13:24 -0700 [thread overview]
Message-ID: <20220324151324.GR8200@magnolia> (raw)
In-Reply-To: <20220323180643.29164-1-nj.shetty@samsung.com>
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
>
prev parent reply other threads:[~2022-03-24 15:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[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 message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220324151324.GR8200@magnolia \
--to=djwong@kernel.org \
--cc=arnav.dawn@samsung.com \
--cc=fstests@vger.kernel.org \
--cc=joshi.k@samsung.com \
--cc=mcgrof@kernel.org \
--cc=nitheshshetty@gmail.com \
--cc=nj.shetty@samsung.com \
--cc=p.raghav@samsung.com \
--cc=wangyugui@e16-tech.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox