linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Qu Wenruo <wqu@suse.com>
To: Nikolay Borisov <nborisov@suse.com>,
	Qu Wenruo <quwenruo.btrfs@gmx.com>,
	linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] btrfs-progs: print-tree: fix chunk/block group flags output
Date: Wed, 13 Oct 2021 07:53:48 +0800	[thread overview]
Message-ID: <7aad61f4-1b47-eef7-82c3-52ed3ff5dc48@suse.com> (raw)
In-Reply-To: <1dea2507-5dfb-75ca-7bcb-f1114f5929b6@suse.com>



On 2021/10/12 21:59, Nikolay Borisov wrote:
> 
> 
> On 12.10.21 г. 15:24, Qu Wenruo wrote:
>>
>>
>> On 2021/10/12 19:56, Nikolay Borisov wrote:
>>>
>>>
>>> On 12.10.21 г. 14:42, Qu Wenruo wrote:
>>>>
> 
> <snip>
> 
>>
>> There is a special handling for SINGLE:
>>
>> +               /*
>> +                * Special handing for SINGLE profile, we don't output
>> "SINGLE"
>> +                * for SINGLE profile, since there is no such bit for it.
>> +                * Thus here we only fill @profile if it's not single.
>> +                */
>> +               if (strncmp(name, "single", strlen("single")) != 0)
>> +                       strncpy(profile, name, BG_FLAG_STRING_LEN);
>>
>> See, if we hit SINGLE profile, we won't populate @profile array.
> 
> Fair enough, I had misread the != 0 check ... However, I'm wondering,
> since this is only used during output, why don't we, for the sake of
> consistency, output SINGLE, despite not having an exclusive bit for it?
> The point of the human readable output is to be useful for users, so
> instead of me having to know an implementation detail that SINGLE is not
> represented by any bit, it will be much more useful if I see that
> something is single profile, no ?

On the other hand, this breaks the consistency of flags output.

We only output flags we have on-disk.

Showing another flag which doesn't have on-disk bit can also be 
confusing, and break the existing output format.

Thanks,
Qu
> 
>>
>> Thanks,
>> Qu
>>
>>>
>>> <snip>
>>>
>>
> 


  reply	other threads:[~2021-10-12 23:54 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-12  2:17 [PATCH] btrfs-progs: print-tree: fix chunk/block group flags output Qu Wenruo
2021-10-12 10:17 ` David Sterba
2021-10-12 10:35 ` Nikolay Borisov
2021-10-12 10:38   ` Nikolay Borisov
2021-10-12 11:42     ` Qu Wenruo
2021-10-12 11:56       ` Nikolay Borisov
2021-10-12 12:24         ` Qu Wenruo
2021-10-12 13:59           ` Nikolay Borisov
2021-10-12 23:53             ` Qu Wenruo [this message]
2021-10-13 10:39               ` David Sterba

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=7aad61f4-1b47-eef7-82c3-52ed3ff5dc48@suse.com \
    --to=wqu@suse.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=nborisov@suse.com \
    --cc=quwenruo.btrfs@gmx.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).