From: Zorro Lang <zlang@redhat.com>
To: fdmanana@kernel.org
Cc: fstests@vger.kernel.org, linux-btrfs@vger.kernel.org,
Filipe Manana <fdmanana@suse.com>
Subject: Re: [PATCH 1/3] common/punch: fix flags printing for filter _filter_fiemap_flags
Date: Tue, 1 Nov 2022 00:23:32 +0800 [thread overview]
Message-ID: <20221031162332.glfpxari24rpwwtu@zlang-mailbox> (raw)
In-Reply-To: <a1a5c698061d4c4e6c8994cde7b51969d8929de3.1667214081.git.fdmanana@suse.com>
On Mon, Oct 31, 2022 at 11:11:19AM +0000, fdmanana@kernel.org wrote:
> From: Filipe Manana <fdmanana@suse.com>
>
> In the filter _filter_fiemap_flags, if we get a flags field that only has
> the 'last' flag set, we end up printing the string "nonelast", which is
> ugly and not intuitive.
>
> For example:
>
> $XFS_IO_PROG -f -c "pwrite 0 64K" $SCRATCH_MNT/foo > /dev/null
> $XFS_IO_PROG -c "fiemap -v" $SCRATCH_MNT/foo | _filter_fiemap_flags
>
> Gives:
>
> 0: [0..127]: nonelast
>
> So fix this by updating the filter's awk code to reset the flags string to
> an empty string if we have the "last" flag set and we haven't updated the
> flags string before. So now the same test gives the following result:
>
> 0: [0..127]: last
>
> Signed-off-by: Filipe Manana <fdmanana@suse.com>
> ---
> common/punch | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/common/punch b/common/punch
> index 47a29c92..94599c35 100644
> --- a/common/punch
> +++ b/common/punch
> @@ -130,6 +130,8 @@ _filter_fiemap_flags()
> if (and(flags, 0x1)) {
> if (set) {
> flag_str = flag_str"|";
> + } else {
> + flag_str = "";
Looks good to me.
We have two cases (g/352, g/353) call this function, I just gave them a test,
looks like this change doesn't affect them.
Reviewed-by: Zorro Lang <zlang@redhat.com>
> }
> flag_str = flag_str"last";
> }
> --
> 2.35.1
>
next prev parent reply other threads:[~2022-10-31 16:24 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-31 11:11 [PATCH 0/3] btrfs: add couple tests to check fiemap correctly reports extent sharedness fdmanana
2022-10-31 11:11 ` [PATCH 1/3] common/punch: fix flags printing for filter _filter_fiemap_flags fdmanana
2022-10-31 16:23 ` Zorro Lang [this message]
2022-10-31 11:11 ` [PATCH 2/3] btrfs: test that fiemap reports extent as not shared after deleting file fdmanana
2022-10-31 16:41 ` Zorro Lang
2022-10-31 16:51 ` Filipe Manana
2022-11-01 5:10 ` Zorro Lang
2022-10-31 11:11 ` [PATCH 3/3] btrfs: test fiemap reports extent as not shared after COWing it in snapshot fdmanana
2022-11-01 5:22 ` Zorro Lang
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=20221031162332.glfpxari24rpwwtu@zlang-mailbox \
--to=zlang@redhat.com \
--cc=fdmanana@kernel.org \
--cc=fdmanana@suse.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;
as well as URLs for NNTP newsgroup(s).