From: Nikolay Borisov <nborisov@suse.com>
To: Qu Wenruo <wqu@suse.com>, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH v2] btrfs-progs: Make "btrfs filesystem df" command to show upper case profile
Date: Thu, 4 Nov 2021 14:17:05 +0200 [thread overview]
Message-ID: <c7c2e955-9fae-b679-3fd9-38f5b627f9df@suse.com> (raw)
In-Reply-To: <20211104015807.35774-1-wqu@suse.com>
On 4.11.21 г. 3:58, Qu Wenruo wrote:
> [BUG]
> Since commit dad03fac3bb8 ("btrfs-progs: switch btrfs_group_profile_str
> to use raid table"), fstests/btrfs/023 and btrfs/151 will always fail.
>
> The failure of btrfs/151 explains the reason pretty well:
>
> btrfs/151 1s ... - output mismatch
> --- tests/btrfs/151.out 2019-10-22 15:18:14.068965341 +0800
> +++ ~/xfstests-dev/results//btrfs/151.out.bad 2021-11-02 17:13:43.879999994 +0800
> @@ -1,2 +1,2 @@
> QA output created by 151
> -Data, RAID1
> +Data, raid1
> ...
> (Run 'diff -u ~/xfstests-dev/tests/btrfs/151.out ~/xfstests-dev/results//btrfs/151.out.bad' to see the entire diff)
>
> [CAUSE]
> Commit dad03fac3bb8 ("btrfs-progs: switch btrfs_group_profile_str to use
> raid table") will use btrfs_raid_array[index].raid_name, which is all
> lower case.
>
> [FIX]
> There is no need to bring such output format change.
>
> So here we split the btrfs_raid_attr::raid_name[] into upper_name[] and
> lower_name[], and make upper and lower case helpers for callers to use.
>
> Now there are several types of callers referring to lower_name and
> upper_name:
>
> - parse_bg_profile()
> It uses strcasecmp(), either case would be fine.
>
> - btrfs_group_profile_str()
> Originally it uses upper case for all profiles except "single".
> Now unified to upper case.
>
> - sprint_profiles()
> It uses lower case.
>
> - bg_flags_to_str()
> It uses upper case.
>
> Signed-off-by: Qu Wenruo <wqu@suse.com>
> ---
> Changelog:
> v2:
> - Add new lower_name[] and upper_name[] for btrfs_raid_attr
> So we don't need temporary string buffer
>
> - Review all commits unifying the output to check what's the original
> output format
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
<snip>
next prev parent reply other threads:[~2021-11-04 12:17 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-04 1:58 [PATCH v2] btrfs-progs: Make "btrfs filesystem df" command to show upper case profile Qu Wenruo
2021-11-04 12:17 ` Nikolay Borisov [this message]
2021-11-04 12:45 ` David Sterba
2021-11-04 14:30 ` David Sterba
-- strict thread matches above, loose matches on Subject: below --
2021-11-02 12:06 Qu Wenruo
2021-11-02 14:12 ` David Sterba
2021-11-02 23:24 ` 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=c7c2e955-9fae-b679-3fd9-38f5b627f9df@suse.com \
--to=nborisov@suse.com \
--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