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) <kreij...@inwind.it>
Key fingerprint = 4769 7E51 5293 D36C 814E  C054 BF04 F161 3DC5 0512
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to