All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shinichiro Kawasaki <shinichiro.kawasaki@wdc.com>
To: Yi Zhang <yi.zhang@redhat.com>
Cc: "chaitanyak@nvidia.com" <chaitanyak@nvidia.com>,
	"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>
Subject: Re: [PATCH blktests 2/3] common/rc: add one function to get test dev size in mb
Date: Tue, 25 Oct 2022 02:29:06 +0000	[thread overview]
Message-ID: <20221025022906.v6lld4proe2dic52@shindev> (raw)
In-Reply-To: <20221024061319.1133470-3-yi.zhang@redhat.com>

On Oct 24, 2022 / 14:13, Yi Zhang wrote:

Short explanation will help to understand why we do this: something like,

  nvme/035 has minimum TEST_DEV size requirement. Add a helper
  function to check it.

> Signed-off-by: Yi Zhang <yi.zhang@redhat.com>
> ---
>  common/rc | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/common/rc b/common/rc
> index e490041..847be1b 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -324,6 +324,14 @@ _get_pci_parent_from_blkdev() {
>  		tail -2 | head -1
>  }
>  
> +_get_test_dev_size_mb() {
> +	local test_dev_sz

Nit: one empty line will make it easier to read.

> +	test_dev_sz=$(blockdev --getsize64 "$TEST_DEV")
> +
> +	echo $((test_dev_sz / 1024 / 1024))
> +

Nit: an empty line not needed.

> +}
> +

I suggest to improve this new function to _require_test_dev_size_mb(). It takes
1st argument as the minimum size size in MB, and if TEST_DEV size is smaller
than that, it set SKIP_REASON and return 1. We can add device_requires() to
nvme/035 to call _require_test_dev_size_mb(). This will skip the test case when
the TEST_DEV is small, and do not report it as a failure.

I also suggest to include nvme/035 change for the size check in this patch. I
think one shot change for function addition and function call will be simpler
for this charge.

>  _require_test_dev_in_hotplug_slot() {
>  	local parent
>  	parent="$(_get_pci_parent_from_blkdev)"
> -- 
> 2.34.1
> 

-- 
Shin'ichiro Kawasaki

  reply	other threads:[~2022-10-25  2:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-24  6:13 [PATCH blktests 0/3] fix for xfs log size change from new version of xfsprogs Yi Zhang
2022-10-24  6:13 ` [PATCH blktests 1/3] common/xfs: set the minimal log size 64m during mkfs.xfs Yi Zhang
2022-10-24  6:13 ` [PATCH blktests 2/3] common/rc: add one function to get test dev size in mb Yi Zhang
2022-10-25  2:29   ` Shinichiro Kawasaki [this message]
2022-11-02  3:01     ` Yi Zhang
2022-10-24  6:13 ` [PATCH blktests 3/3] common/xfs: update _xfs_run_fio_verify_io to accept the size parameter Yi Zhang
2022-10-25  2:49   ` Shinichiro Kawasaki
2022-11-02  3:04     ` Yi Zhang

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=20221025022906.v6lld4proe2dic52@shindev \
    --to=shinichiro.kawasaki@wdc.com \
    --cc=chaitanyak@nvidia.com \
    --cc=linux-block@vger.kernel.org \
    --cc=yi.zhang@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.