[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6odezvt3uwnc3c6353qlvqdxadmn5giihsj77xvwi6h4655la4@ezvpevwxfsan>
Date: Fri, 28 Apr 2023 02:54:19 +0000
From: Shinichiro Kawasaki <shinichiro.kawasaki@....com>
To: Daniel Wagner <dwagner@...e.de>
CC: Hannes Reinecke <hare@...e.de>,
"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 3/9] common-xfs: Make size argument
optional for _xfs_run_fio_verify_io
On Apr 21, 2023 / 08:54, Daniel Wagner wrote:
> On Fri, Apr 21, 2023 at 08:27:35AM +0200, Hannes Reinecke wrote:
> > On 4/21/23 08:04, Daniel Wagner wrote:
> > > Make the size argument optional by reading the filesystem info. The
> > > caller doesn't have to guess (or calculate) how big the max IO size.
> > > The log data structure of XFS is reducing the capacity.
> > >
> > > Signed-off-by: Daniel Wagner <dwagner@...e.de>
> > > ---
> > > common/xfs | 6 ++++++
> > > tests/nvme/012 | 2 +-
> > > tests/nvme/013 | 2 +-
> > > tests/nvme/035 | 2 +-
> > > 4 files changed, 9 insertions(+), 3 deletions(-)
> > >
> > > diff --git a/common/xfs b/common/xfs
> > > index 2c5d96164ac1..ec35599e017b 100644
> > > --- a/common/xfs
> > > +++ b/common/xfs
> > > @@ -27,6 +27,12 @@ _xfs_run_fio_verify_io() {
> > > _xfs_mkfs_and_mount "${bdev}" "${mount_dir}" >> "${FULL}" 2>&1
> > > + if [[ -z "${sz}" ]]; then
> > > + local avail
> > > + avail="$(df --output=avail "${mount_dir}" | awk 'NR==2 {print $1}')"
> >
> > df --output=avail "${mount_dir}" | tail -1
>
> Sure, don't think it matters.
>
> > > + sz="$(printf "%d" $((avail / 1024 - 1 )))m"
> >
> > sz=$((avail / 1024 - 1))
>
> I tried this but the devision is likely to return a floating point which fio
> doesn't like. Is there a way to tell bash to do a pure integer devision?
Hmm, AFAIK, bash arithmetic supports integer only. I tried below, and bash did
not return floating value...
$ avail=90000; echo $((avail/1024))
87
Assuming bash arithmetic supports integer only, -1 will not be required in the
calculation.
Powered by blists - more mailing lists