From patchwork Fri Jul 1 12:55:36 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephane Chazelas X-Patchwork-Id: 935782 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p61Ctlur006193 for ; Fri, 1 Jul 2011 12:55:47 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755723Ab1GAMzo (ORCPT ); Fri, 1 Jul 2011 08:55:44 -0400 Received: from mail.seebyte.com ([80.193.213.29]:55939 "EHLO mail.seebyte.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755080Ab1GAMzo (ORCPT ); Fri, 1 Jul 2011 08:55:44 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.seebyte.com (Postfix) with ESMTP id 32F302E9B; Fri, 1 Jul 2011 13:55:43 +0100 (BST) X-Virus-Scanned: Debian amavisd-new at mail.seebyte.com Received: from mail.seebyte.com ([127.0.0.1]) by localhost (seebyte2.seebyte.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hDbb2CtsFujv; Fri, 1 Jul 2011 13:55:37 +0100 (BST) Received: from sbl-sc-laptop1.seebyte.com (stephane-chazelas-laptop1.seebyte.com [10.10.10.4]) by mail.seebyte.com (Postfix) with ESMTPSA id EEC092E67; Fri, 1 Jul 2011 13:55:36 +0100 (BST) Received: from stephane by sbl-sc-laptop1.seebyte.com with local (Exim 4.76) (envelope-from ) id 1QcdFw-0007FN-MT; Fri, 01 Jul 2011 13:55:36 +0100 Date: Fri, 1 Jul 2011 13:55:36 +0100 From: Stephane Chazelas To: Hugo Mills , Andreas Philipp , linux-btrfs@vger.kernel.org Subject: Re: [PATCH] Re: [btrfs-progs integration] incorrect argument checking for "btrfs sub snap -r" Message-ID: References: <4E0BC7AA.7000709@cn.fujitsu.com> <4E0C3F72.5040508@gmail.com> <20110630105813.GD11170@carfax.org.uk> <4E0CE2B3.1080600@gmail.com> <4E0D9DCA.1090204@gmail.com> <20110701104223.GA7606@carfax.org.uk> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20110701104223.GA7606@carfax.org.uk> User-Agent: Mutt/1.5.16 (2007-09-19) Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Fri, 01 Jul 2011 12:55:47 +0000 (UTC) 2011-07-01 11:42:23 +0100, Hugo Mills: [...] > > > diff --git a/btrfs.c b/btrfs.c > > > index e117172..b50c58a 100644 > > > --- a/btrfs.c > > > +++ b/btrfs.c > > > @@ -49,7 +49,7 @@ static struct Command commands[] = { > > > /* > > > avoid short commands different for the case only > > > */ > > > - { do_clone, 2, > > > + { do_clone, -2, > > > "subvolume snapshot", "[-r] [/]\n" > > > "Create a writable/readonly snapshot of the subvolume with\n" > > > "the name in the directory.", > > > diff --git a/btrfs_cmds.c b/btrfs_cmds.c > > > index 1d18c59..3415afc 100644 > > > --- a/btrfs_cmds.c > > > +++ b/btrfs_cmds.c > > > @@ -355,7 +355,7 @@ int do_clone(int argc, char **argv) > > > return 1; > > > } > > > } > > > - if (argc - optind < 2) { > > > + if (argc - optind != 2) { > > > fprintf(stderr, "Invalid arguments for subvolume snapshot\n"); > > > free(argv); > > > return 1; > > > > > Thanks for having another look at this. You are perfectly right. Should > > we patch my patch or should I rework a corrected version? What do you > > think Hugo? > > Could you send a follow-up patch with just the second hunk, please? > I screwed up the process with this (processing patches too quickly to > catch the review), and I've already published the patch with the first > hunk, above, into the for-chris branch. Hugo, not sure what you mean nor whom you're talking to, but I can certainly copy-paste the second hunk from above here: Cheers, Stephane Signed-off-by: Andreas Philipp --- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/btrfs_cmds.c b/btrfs_cmds.c index 1d18c59..3415afc 100644 --- a/btrfs_cmds.c +++ b/btrfs_cmds.c @@ -355,7 +355,7 @@ int do_clone(int argc, char **argv) return 1; } } - if (argc - optind < 2) { + if (argc - optind != 2) { fprintf(stderr, "Invalid arguments for subvolume snapshot\n"); free(argv); return 1;