From: Goffredo Baroncelli <kreijack@inwind.it>
To: Ilya Dryomov <idryomov@gmail.com>
Cc: Chris Mason <chris.mason@oracle.com>, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] Btrfs-progs: restriper interface
Date: Sat, 7 Jan 2012 18:21:14 +0100 [thread overview]
Message-ID: <201201071821.15315.kreijack@inwind.it> (raw)
In-Reply-To: <201201071749.01583.kreijack@inwind.it>
On Saturday, 07 January, 2012 17:49:01 Goffredo Baroncelli wrote:
> On Saturday, 07 January, 2012 16:14:43 you wrote:
[..]
> > btrfs instead tries to be clever, and if ip was doing the same thing
> > btrfs does you would get "ambiguous command 'r'" error in response to
> > "ip r".
>
> You are right, but this is a bug.
>
> 1) btrfs s sn -> means btrfs subvolume snapshot
> 2) btrfs s se -> means btrfs subvolume set-default
> 3) btrfs s s -> is ambiguous command because it could means both 1) and 2)
>
> However if we try 1) we get an error. But this is not the intended
> behavior. I have to investigate why.
The change should be quite simple
diff --git a/btrfs.c b/btrfs.c
index 1def354..981afa4 100644
--- a/btrfs.c
+++ b/btrfs.c
@@ -268,8 +268,8 @@ static int check_ambiguity(struct Command *cmd, char
**argv)
if( cp->ncmds < i )
continue;
- for( skip = 0, j = 0 ; j < i ; j++ )
- if( strcmp(cmd->cmds[j], cp->cmds[j])){
+ for( skip = 0, j = 0 ; j <= i ; j++ )
+ if( !strcmp(cmd->cmds[j], cp->cmds[j])){
skip=1;
break;
}
But before issue a new patch I want to be sure about its correctness. I have
to make a more formal test.
>
> BR
> G.Baroncelli
>
> > Thanks,
> >
> > Ilya
--
gpg key@ keyserver.linux.it: Goffredo Baroncelli (ghigo) <kreijack@inwind.it>
Key fingerprint = 4769 7E51 5293 D36C 814E C054 BF04 F161 3DC5 0512
prev parent reply other threads:[~2012-01-07 17:21 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-06 14:37 [PATCH] Btrfs-progs: restriper interface Ilya Dryomov
2012-01-06 14:38 ` [PATCH] Btrfs-progs: add restriper commands Ilya Dryomov
2012-01-07 12:48 ` [PATCH] Btrfs-progs: restriper interface Goffredo Baroncelli
2012-01-07 14:25 ` Ilya Dryomov
2012-01-07 14:32 ` Roman Mamedov
2012-01-07 15:14 ` Ilya Dryomov
2012-01-07 16:49 ` Goffredo Baroncelli
2012-01-07 17:21 ` Goffredo Baroncelli [this message]
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=201201071821.15315.kreijack@inwind.it \
--to=kreijack@inwind.it \
--cc=chris.mason@oracle.com \
--cc=idryomov@gmail.com \
--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.