FS/XFS testing framework
 help / color / mirror / Atom feed
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
Subject: Re: [PATCH] generic/108: use sysfs values for logical,physical block size in scsi_debug
Date: Mon, 21 Mar 2022 13:21:33 -0700	[thread overview]
Message-ID: <20220321202133.GJ8200@magnolia> (raw)
In-Reply-To: <20220301212947.28660-1-nj.shetty@samsung.com>

On Wed, Mar 02, 2022 at 02:59:47AM +0530, Nitesh Shetty wrote:
> scsi_debug device used for test, is created with assumption of 512 bytes
> logical and physical block size.
> This causes error in lvcreate step, when SCRATCH_DEV device lba is not
> 512 bytes. This can be solved by reading block size from sysfs of device.
> If sysfs is missing fallback to 512 bytes as default.
> 
> Signed-off-by: Nitesh Shetty <nj.shetty@samsung.com>
> ---
>  tests/generic/108 | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/generic/108 b/tests/generic/108
> index ad43269f..db0e9bd0 100755
> --- a/tests/generic/108
> +++ b/tests/generic/108
> @@ -42,8 +42,11 @@ _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)

This causes a regression if $SCRATCH_DEV is not a raw block device:

# SCRATCH_DEV=/dev/sda4 ./check generic/108
...
--- generic/108.out
+++ generic/108.out.bad
@@ -1,2 +1,4 @@
 QA output created by 108
+cat: /sys/block/sda4/queue/physical_block_size: No such file or directory
+cat: /sys/block/sda4/queue/logical_block_size: No such file or directory
 fsync: Input/output error

--D

> +
>  # _get_scsi_debug_dev returns a scsi debug device with 128M in size by default
> -SCSI_DEBUG_DEV=`_get_scsi_debug_dev 512 512 0 300`
> +SCSI_DEBUG_DEV=`_get_scsi_debug_dev ${physical:-512} ${logical:-512} 0 300`
>  test -b "$SCSI_DEBUG_DEV" || _notrun "Failed to initialize scsi debug device"
>  echo "SCSI debug device $SCSI_DEBUG_DEV" >>$seqres.full
>  
> 
> base-commit: 2ea74ba4e70b546279896e2a733c8c7f4b206193
> -- 
> 2.25.1
> 

  parent reply	other threads:[~2022-03-21 20:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20220301213455epcas5p30ff48390a70523f4bc3d99de0027d3bd@epcas5p3.samsung.com>
2022-03-01 21:29 ` [PATCH] generic/108: use sysfs values for logical,physical block size in scsi_debug Nitesh Shetty
2022-03-02 20:36   ` Luis Chamberlain
2022-03-21 20:21   ` Darrick J. Wong [this message]
2022-03-22  8:26     ` Nitesh Shetty
2022-03-22 16:07       ` Darrick J. Wong
2022-03-23 12:07         ` Nitesh Shetty
2022-03-23 16:53           ` Darrick J. Wong

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=20220321202133.GJ8200@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 \
    /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