From: Anand Jain <anand.jain@oracle.com>
To: Qu Wenruo <wqu@suse.com>,
linux-btrfs@vger.kernel.org, fstests@vger.kernel.org
Subject: Re: [PATCH] fstests: btrfs/002: fix the OOM caused by too large block size
Date: Tue, 22 Oct 2024 19:24:51 +0800 [thread overview]
Message-ID: <8f1a88d5-3199-473f-881b-1844c4f1cfe2@oracle.com> (raw)
In-Reply-To: <20241012071824.124468-1-wqu@suse.com>
looks good.
Nits:
> For 64K sector size, the BLKS is 512, and BLKS is 128 (one 64K sector).
^^ NBLKS
> $FALLOC is the correct value of 64K (10K rounded up to 64K).
>
Not sure what you meant here. More below.
> diff --git a/tests/btrfs/002 b/tests/btrfs/002
> index f223cc60..0c231b89 100755
> --- a/tests/btrfs/002
> +++ b/tests/btrfs/002
> @@ -70,19 +70,14 @@ _read_modify_write()
> _fill_blk()
> {
> local FSIZE
> - local BLKS
> - local NBLK
> - local FALLOC
> - local WS
> + local NEWSIZE
>
> for i in `find /$1 -type f`
> do
> FSIZE=`stat -t $i | cut -d" " -f2`
> - BLKS=`stat -c "%B" $i`
> - NBLK=`stat -c "%b" $i`
> - FALLOC=$(($BLKS * $NBLK))
> - WS=$(($FALLOC - $FSIZE))
> - _ddt of=$i oseek=$FSIZE obs=$WS count=1 status=noxfer 2>/dev/null &
> + NEWSIZE=$(( ($FSIZE + $blksize -1 ) / $blksize * $blksize ))
Please add extra ( ) otherwise it is very confusing.
NEWSIZE=$(( (($FSIZE + $blksize -1 ) / $blksize) * $blksize ))
> +
> + $XFS_IO_PROG -c "pwrite -i /dev/urandom $FSIZE $(( $NEWSIZE - $FSIZE ))" $i > /dev/null &
Reviewed-by: Anand Jain <anand.jain@oracle.com>
Thanks, Anand
next prev parent reply other threads:[~2024-10-22 11:25 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-12 7:18 [PATCH] fstests: btrfs/002: fix the OOM caused by too large block size Qu Wenruo
2024-10-22 11:24 ` Anand Jain [this message]
2024-10-22 21:08 ` Qu Wenruo
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=8f1a88d5-3199-473f-881b-1844c4f1cfe2@oracle.com \
--to=anand.jain@oracle.com \
--cc=fstests@vger.kernel.org \
--cc=linux-btrfs@vger.kernel.org \
--cc=wqu@suse.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;
as well as URLs for NNTP newsgroup(s).