FS/XFS testing framework
 help / color / mirror / Atom feed
From: Qu Wenruo <wqu@suse.com>
To: Anand Jain <anand.jain@oracle.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: Wed, 23 Oct 2024 07:38:53 +1030	[thread overview]
Message-ID: <47f6b493-3eac-4c00-9ce0-5b24a5776867@suse.com> (raw)
In-Reply-To: <8f1a88d5-3199-473f-881b-1844c4f1cfe2@oracle.com>



在 2024/10/22 21:54, Anand Jain 写道:
> 
> 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.

I just mean the old $FALLOC value is 64K, which is correct.

I didn't see anything confusing here, I was explaining each variable 
involved.

> 
> 
>> 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 ))

I didn't see how it's confusing.

It's the very basic round down, and I didn't see any kernel code doing 
extra () just for round down.

Thanks,
Qu
> 
> 
> 
>> +
>> +        $XFS_IO_PROG -c "pwrite -i /dev/urandom $FSIZE $(( $NEWSIZE - 
>> $FSIZE ))" $i > /dev/null &
> 
> 
> 
> Reviewed-by: Anand Jain <anand.jain@oracle.com>
> 
> 
> Thanks, Anand


      reply	other threads:[~2024-10-22 21:08 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
2024-10-22 21:08   ` Qu Wenruo [this message]

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=47f6b493-3eac-4c00-9ce0-5b24a5776867@suse.com \
    --to=wqu@suse.com \
    --cc=anand.jain@oracle.com \
    --cc=fstests@vger.kernel.org \
    --cc=linux-btrfs@vger.kernel.org \
    /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