From: Jeff Liu <jeff.liu@oracle.com>
To: linux-btrfs@vger.kernel.org, dsterba@suse.cz,
Gene Czarcinski <gene@czarc.net>
Subject: Re: [PATCH 1/2] btrfs-progs: refactor check_label()
Date: Wed, 30 Jan 2013 00:52:53 +0800 [thread overview]
Message-ID: <5107FE65.8090603@oracle.com> (raw)
In-Reply-To: <20130129151916.GL16977@twin.jikos.cz>
On 01/29/2013 11:19 PM, David Sterba wrote:
> On Tue, Jan 29, 2013 at 02:24:12PM +0800, Jeff Liu wrote:
>> --- a/utils.c
>> +++ b/utils.c
>> @@ -1122,17 +1122,21 @@ char *pretty_sizes(u64 size)
>> -1 if the label is too long
>> -2 if the label contains an invalid character
>> */
>> -int check_label(char *input)
>> +static int check_label(char *input)
>> {
>> int i;
>> int len = strlen(input);
>>
>> - if (len > BTRFS_LABEL_SIZE) {
>> + if (len > BTRFS_LABEL_SIZE - 1) {
>> + fprintf(stderr, "ERROR: Label %s is too long (max %d)\n",
>> + input, BTRFS_LABEL_SIZE - 1);
>> return -1;
>> }
>>
>> for (i = 0; i < len; i++) {
>> if (input[i] == '/' || input[i] == '\\') {
>> + fprintf(stderr, "ERROR: Label %s contains invalid "
>> + "characters\n", input);
>> return -2;
>> }
>
> Plase drop this check, see
> http://repo.or.cz/w/btrfs-progs-unstable/devel.git/commit/79e0e445fc2365e47fc7f060d5a4445d37e184b8
> (also function comment and maybe the callers)
>
> "btrfs-progs: kill check for /'s in labels
>
> This patch kills a check in mkfs's label stuff which doesn't allow
> labels that have /'s in them. This causes problems for Anaconda which
> try to label volumes with their mountpoints."
> (mkfs.c)
Ok, so looks we can safely clean this routine out of the code base since
there is no other users call it if am not missing anything.
Thanks,
-Jeff
next prev parent reply other threads:[~2013-01-29 16:53 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-29 6:24 [PATCH 0/2] btrfs-progs: btrfslabel source code consolidation Jeff Liu
2013-01-29 6:24 ` [PATCH 1/2] btrfs-progs: refactor check_label() Jeff Liu
2013-01-29 15:19 ` David Sterba
2013-01-29 16:52 ` Jeff Liu [this message]
2013-01-29 6:24 ` [PATCH 2/2] btrfs-progs: remove btrfslabel.[c|h] Jeff Liu
2013-01-29 10:26 ` Stefan Behrens
2013-01-29 10:28 ` Jeff Liu
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=5107FE65.8090603@oracle.com \
--to=jeff.liu@oracle.com \
--cc=dsterba@suse.cz \
--cc=gene@czarc.net \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.