public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Su Yue <l@damenly.su>
To: Chengguang Xu <cgxu519@mykernel.net>
Cc: guaneryu@gmail.com, fstests@vger.kernel.org
Cc: nborisov@suse.com, linux-xfs@vger.kernel.org
Subject: Re: [PATCH] generic/473: fix expectation properly in out file
Date: Wed, 24 Feb 2021 15:52:17 +0800	[thread overview]
Message-ID: <4ki1rjgu.fsf@damenly.su> (raw)
In-Reply-To: <20210223134042.2212341-1-cgxu519@mykernel.net>


Cc to the author and linux-xfs, since it's xfsprogs related.

On Tue 23 Feb 2021 at 21:40, Chengguang Xu <cgxu519@mykernel.net> 
wrote:

> It seems the expected result of testcase of "Hole + Data"
> in generic/473 is not correct, so just fix it properly.
>

But it's not proper...

> Signed-off-by: Chengguang Xu <cgxu519@mykernel.net>
> ---
>  tests/generic/473.out | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tests/generic/473.out b/tests/generic/473.out
> index 75816388..f1ee5805 100644
> --- a/tests/generic/473.out
> +++ b/tests/generic/473.out
> @@ -6,7 +6,7 @@ Data + Hole
>  1: [256..287]: hole
>  Hole + Data
>  0: [0..127]: hole
> -1: [128..255]: data
> +1: [128..135]: data
>
The line is produced by `$XFS_IO_PROG -c "fiemap -v 0 65k" $file | 
_filter_fiemap`.
0-64k is a hole and 64k-128k is a data extent.
fiemap ioctl always returns *complete* ranges of extents.

You may ask why the ending hole range is not aligned to 128 in 
473.out. Because
fiemap ioctl returns nothing of querying holes. xfs_io does the 
extra
print work for holes.

xfsprogs-dev/io/fiemap.c:
for holes:
 153     if (lstart > llast) {
 154         print_hole(0, 0, 0, cur_extent, lflag, true, llast, 
 lstart);
 155         cur_extent++;
 156         num_printed++;
 157     }

for the ending hole:
  381     if (cur_extent && last_logical < range_end)
  382         print_hole(foff_w, boff_w, tot_w, cur_extent, lflag, 
  !vflag,
  383                BTOBBT(last_logical), BTOBBT(range_end));

>  Hole + Data + Hole
>  0: [0..127]: hole
>  1: [128..255]: data

       reply	other threads:[~2021-02-24  8:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20210223134042.2212341-1-cgxu519@mykernel.net>
2021-02-24  7:52 ` Su Yue [this message]
2021-02-24  8:10   ` [PATCH] generic/473: fix expectation properly in out file Su Yue
2021-02-24  8:55     ` Chengguang Xu
     [not found]   ` <177d33c0982.10b8858b515683.1169986601273192029@mykernel.net>
2021-02-24  9:16     ` Chengguang Xu
     [not found]     ` <wnuxq0px.fsf@damenly.su>
2021-02-24  9:37       ` Chengguang Xu
2021-02-24 13:31         ` Eryu Guan
2021-02-24 13:48           ` Chengguang Xu

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=4ki1rjgu.fsf@damenly.su \
    --to=l@damenly.su \
    --cc=cgxu519@mykernel.net \
    --cc=fstests@vger.kernel.org \
    --cc=guaneryu@gmail.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