[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <s4xicrnevbwapdwvw5wl2z4bpm6vv6q62lcgimy6wcqnbf6tbo@u7alfvt4bmen>
Date: Fri, 21 Apr 2023 08:54:42 +0200
From: Daniel Wagner <dwagner@...e.de>
To: Hannes Reinecke <hare@...e.de>
Cc: linux-nvme@...ts.infradead.org, linux-kernel@...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 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?
Powered by blists - more mailing lists