From: Jeffle Xu <jefflexu@linux.alibaba.com>
To: fstests@vger.kernel.org
Cc: linux-ext4@vger.kernel.org, joseph.qi@linux.alibaba.com,
Tomas Racek <tracek@redhat.com>
Subject: [PATCH] xfstests: 298: fix failure on ext4 with bigalloc
Date: Fri, 24 Apr 2020 17:11:12 +0800 [thread overview]
Message-ID: <1587719472-129572-1-git-send-email-jefflexu@linux.alibaba.com> (raw)
From: Tomas Racek <tracek@redhat.com>
It is just a resend of this patch from "Tomas Racek <tracek@redhat.com>".
Recently we run xfstests on ext4 with 'bigalloc' feature enabled, and
come across some failure due to poor adaption for ext4 bigalloc. One
if the failed cases is shared/298. I find this patch on internet [1] and
it works in my case. I have no idea why this patch have not been merged.
Maybe this buddy didn't send this patch at that time, or it was rejected
for some reason but I can't find any discussion on internet.
[1] https://lkml.org/lkml/2013/6/18/329
The original commit log:
Count with cluster size instead of block size if bigalloc is used.
Signed-off-by: Tomas Racek <tracek@redhat.com>
---
tests/shared/298 | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/tests/shared/298 b/tests/shared/298
index 5d6c6cc..86b7cdc 100755
--- a/tests/shared/298
+++ b/tests/shared/298
@@ -60,15 +60,21 @@ get_free_sectors()
{
case $FSTYP in
ext4)
+ cluster_size=$($DUMPE2FS_PROG $img_file 2>&1 | sed -n 's/Cluster size: *\(.*\)/\1/p')
+ if [ -n "$cluster_size" ]; then
+ blocks_per_cluster=`expr $cluster_size / $block_size`
+ else
+ blocks_per_cluster=1
+ fi
$UMOUNT_PROG $loop_mnt
$DUMPE2FS_PROG $img_file 2>&1 | grep " Free blocks" | cut -d ":" -f2- | \
tr ',' '\n' | $SED_PROG 's/^ //' | \
- $AWK_PROG -v spb=$sectors_per_block 'BEGIN{FS="-"};
+ $AWK_PROG -v spb=$sectors_per_block -v bpc=$blocks_per_cluster 'BEGIN{FS="-"};
NF {
if($2 != "") # range of blocks
- print spb * $1, spb * ($2 + 1) - 1;
+ print spb * $1, spb * ($2 + bpc) - 1;
else # just single block
- print spb * $1, spb * ($1 + 1) - 1;
+ print spb * $1, spb * ($1 + bpc) - 1;
}'
;;
xfs)
--
1.8.3.1
reply other threads:[~2020-04-24 9:11 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1587719472-129572-1-git-send-email-jefflexu@linux.alibaba.com \
--to=jefflexu@linux.alibaba.com \
--cc=fstests@vger.kernel.org \
--cc=joseph.qi@linux.alibaba.com \
--cc=linux-ext4@vger.kernel.org \
--cc=tracek@redhat.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).