lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 28 Apr 2023 02:44:44 +0000
From:   Shinichiro Kawasaki <shinichiro.kawasaki@....com>
To:     Daniel Wagner <dwagner@...e.de>
CC:     "linux-nvme@...ts.infradead.org" <linux-nvme@...ts.infradead.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "linux-block@...r.kernel.org" <linux-block@...r.kernel.org>,
        Chaitanya Kulkarni <kch@...dia.com>,
        Shin'ichiro Kawasaki <shinichiro@...tmail.com>
Subject: Re: [PATCH REPOST blktests v2 2/9] nvme: Do not hard code device size
 for dd test

On Apr 21, 2023 / 08:04, Daniel Wagner wrote:
> Read the block device sizes instead hard coding them.

I suggest to add this to clarify the purpose of this commit:
  ".., so that the device size can be configurable in future."

> 
> Signed-off-by: Daniel Wagner <dwagner@...e.de>
> ---
>  tests/nvme/014 | 10 +++++++++-
>  tests/nvme/015 | 10 +++++++++-
>  2 files changed, 18 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/nvme/014 b/tests/nvme/014
> index d13cff7921da..28913641ae40 100755
> --- a/tests/nvme/014
> +++ b/tests/nvme/014
> @@ -23,6 +23,9 @@ test() {
>  	local port
>  	local nvmedev
>  	local loop_dev
> +	local size
> +	local bs
> +	local count
>  	local file_path="$TMPDIR/img"
>  	local subsys_name="blktests-subsystem-1"
>  
> @@ -41,7 +44,12 @@ test() {
>  	cat "/sys/block/${nvmedev}n1/uuid"
>  	cat "/sys/block/${nvmedev}n1/wwid"
>  
> -	dd if=/dev/urandom of="/dev/${nvmedev}n1" count=128000 bs=4k status=none
> +	size="$(blockdev --getsize64 "/dev/${nvmedev}n1")"
> +	bs="$(blockdev --getbsz "/dev/${nvmedev}n1")"
> +	count=$((size / bs - 1))

Do we need -1?

> +
> +	dd if=/dev/urandom of="/dev/${nvmedev}n1" \
> +		count="${count}" bs="${bs}" status=none
>  
>  	nvme flush "/dev/${nvmedev}" -n 1
>  
> diff --git a/tests/nvme/015 b/tests/nvme/015
> index bb52ba2598db..2f7957caac88 100755
> --- a/tests/nvme/015
> +++ b/tests/nvme/015
> @@ -22,6 +22,9 @@ test() {
>  
>  	local port
>  	local nvmedev
> +	local size
> +	local bs
> +	local count
>  	local file_path="$TMPDIR/img"
>  	local subsys_name="blktests-subsystem-1"
>  
> @@ -38,7 +41,12 @@ test() {
>  	cat "/sys/block/${nvmedev}n1/uuid"
>  	cat "/sys/block/${nvmedev}n1/wwid"
>  
> -	dd if=/dev/urandom of="/dev/${nvmedev}n1" count=128000 bs=4k status=none
> +	size="$(blockdev --getsize64 "/dev/${nvmedev}n1")"
> +	bs="$(blockdev --getbsz "/dev/${nvmedev}n1")"
> +	count=$((size / bs - 1))

Same here.

> +
> +	dd if=/dev/urandom of="/dev/${nvmedev}n1" \
> +		count="${count}" bs="${bs}" status=none
>  
>  	nvme flush "/dev/${nvmedev}n1" -n 1
>  
> -- 
> 2.40.0
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ