From nobody@FreeBSD.org Sun Mar 7 04:00:08 2010 Return-Path: Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 900E0106566C for ; Sun, 7 Mar 2010 04:00:08 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id 71ACC8FC08 for ; Sun, 7 Mar 2010 04:00:08 +0000 (UTC) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.3/8.14.3) with ESMTP id o27408N5054630 for ; Sun, 7 Mar 2010 04:00:08 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id o27407n1054629; Sun, 7 Mar 2010 04:00:07 GMT (envelope-from nobody) Message-Id: <201003070400.o27407n1054629@www.freebsd.org> Date: Sun, 7 Mar 2010 04:00:07 GMT From: Garrett Cooper To: freebsd-gnats-submit@FreeBSD.org Subject: geom(1) tool parsing non-subclass command broken X-Send-Pr-Version: www-3.1 X-GNATS-Notify: >Number: 144521 >Category: bin >Synopsis: [geom] geom(8) tool parsing non-subclass command broken >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-geom >State: closed >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Mar 07 04:10:00 UTC 2010 >Closed-Date: Mon Oct 18 00:22:07 UTC 2010 >Last-Modified: Mon Oct 18 00:22:07 UTC 2010 >Originator: Garrett Cooper >Release: RELENG_8 / 9-CURRENT >Organization: Cisco Systems, Inc. >Environment: FreeBSD bayonetta.localdomain 8.0-RELEASE FreeBSD 8.0-RELEASE #0: Sat Nov 21 15:02:08 UTC 2009 root@mason.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC amd64 FreeBSD bayonetta.localdomain 9.0-CURRENT FreeBSD 9.0-CURRENT #2: Thu Mar 4 13:16:39 PST 2010 gcooper@bayonetta.localdomain:/usr/obj/usr/src/sys/BAYONETTA amd64 >Description: Arguments parsing is broken today when geom is invoked directly (as opposed to gjournal, etc): [gcooper@bayonetta ~]$ geom load usage: geom load help geom load list [name ...] geom load status [-s] [name ...] geom load load [-v] geom load unload [-v] [gcooper@bayonetta ~]$ geom unload usage: geom unload help geom unload list [name ...] geom unload status [-s] [name ...] geom unload load [-v] geom unload unload [-v] [gcooper@bayonetta ~]$ gjournal load gjournal: Command 'load' not available. >How-To-Repeat: geom unload >Fix: Invoke the `subclass' commands like: gjournal load gjournal unload etc. >Release-Note: >Audit-Trail: Responsible-Changed-From-To: freebsd-bugs->freebsd-geom Responsible-Changed-By: linimon Responsible-Changed-When: Mon Mar 8 07:18:07 UTC 2010 Responsible-Changed-Why: Over to maintainer(s). http://www.freebsd.org/cgi/query-pr.cgi?pr=144521 From: "Andrey V. Elsukov" To: bug-followup@FreeBSD.org, gcooper@FreeBSD.org Cc: Subject: Re: bin/144521: geom(1) tool parsing non-subclass command broken Date: Mon, 28 Jun 2010 10:04:16 +0400 Hi, Garrett Do you still have this problem? I can't reproduce it on 9.0-CURRENT. -- WBR, Andrey V. Elsukov From: Garrett Cooper To: "Andrey V. Elsukov" Cc: bug-followup@freebsd.org Subject: Re: bin/144521: geom(1) tool parsing non-subclass command broken Date: Sun, 27 Jun 2010 23:45:01 -0700 2010/6/27 Andrey V. Elsukov : > Hi, Garrett > > Do you still have this problem? I can't reproduce it > on 9.0-CURRENT. Hi Andrey, Does this work for you? # geom label help usage: geom label clear [-v] dev ... geom label create [-v] name dev geom label destroy [-fv] name ... geom label dump dev ... geom label label [-v] name dev geom label stop [-fv] name ... geom label help geom label list [name ...] geom label status [-s] [name ...] geom label load [-v] geom label unload [-v] # geom label load -v geom: Command 'load' not available. I am still running an older version of CURRENT though, due to stability issues on later versions that I've run into... FreeBSD bayonetta.local 9.0-CURRENT FreeBSD 9.0-CURRENT #0 r206173M: Mon Apr 26 22:45:06 PDT 2010 root@bayonetta.local:/usr/obj/usr/src/sys/BAYONETTA.ata amd64 Thanks! -Garrett State-Changed-From-To: open->feedback State-Changed-By: arundel State-Changed-When: Thu Sep 16 19:32:17 UTC 2010 State-Changed-Why: hi garrett, i can't really spot the problem in this PR. with 'geom load' and 'geom unload' you tell geom to operate on classes 'load' and 'unload' (which both don't exist). the only way to use geom in a sensible way without specifying a class seems to be 'geom help', which is an alias for 'geom'. could be a bit more specific? http://www.freebsd.org/cgi/query-pr.cgi?pr=144521 From: Bruce Cran To: bug-followup@FreeBSD.org, gcooper@FreeBSD.org Cc: Subject: Re: bin/144521: geom(1) tool parsing non-subclass command broken Date: Thu, 16 Sep 2010 20:47:00 +0100 It looks like you're choosing the wrong commands. For example: > geom label dump geom: Too few arguments. > geom label status > geom label list > geom label create geom: Permission denied So "help" and "load" subcommands don't work, but the others seem to. -- Bruce Cran From: Garrett Cooper To: Bruce Cran Cc: bug-followup@freebsd.org Subject: Re: bin/144521: geom(1) tool parsing non-subclass command broken Date: Thu, 16 Sep 2010 15:23:09 -0700 On Thu, Sep 16, 2010 at 12:47 PM, Bruce Cran wrote: > It looks like you're choosing the wrong commands. For example: > >> geom label dump > geom: Too few arguments. >> geom label status >> geom label list >> geom label create > geom: Permission denied > > So "help" and "load" subcommands don't work, but the others seem to. It's been a while I think this is the ultimate bug I was seeing: $ geom --help usage: geom --help help geom --help list [name ...] geom --help status [-s] [name ...] geom --help load [-v] geom --help unload [-v] $ uname -a FreeBSD bioshock.cisco.com 9.0-CURRENT FreeBSD 9.0-CURRENT #2 r206173: Tue May 25 13:21:21 PDT 2010 root@bioshock.cisco.com:/usr/obj/usr/src/sys/BIOSHOCK amd64 Note how it's not parsing the class to see whether or not it's valid, and is just producing non-sensical output. Ultimately geom(8) should: 1. Parse out the class and determine whether or not it's valid. 2. Provide the help specific to that class. The recursive logic is just complicated and unnecessary (IMO) more than anything else. Once upon a time someone said that this command (geom) was going away and only subclass commands were going to be available, so I'm not sure whether or not that particular datapoint is factored in with the issue I reported in this bug. Thanks, -Garrett From: Alexander Best To: bug-followup@freebsd.org Cc: Subject: Re: bin/144521: [geom] geom(8) tool parsing non-subclass command broken Date: Mon, 20 Sep 2010 15:27:19 +0000 i just had a look at sbin/geom/core/geom.c the logic seems to be this: 1) if there's no arg or the arg is "help" or "-h" then display usage() 2) if that's not the case get the possible options which a classe defines and add then to these options which are always printed even if the class doesn't support them or the class doesn't exist: usage: geom CLASS help geom CLASS list [name ...] geom CLASS status [-s] [name ...] geom CLASS load [-v] geom CLASS unload [-v] so if i understood it correctly 2 semantic changes should happen: 1) if the class doesn exist print out something like: geom: Unknown class: CLASS. usage: geom [options] 2) if a valid class has been specified the usage output should only show commands which are supported by the class. cheers. alex -- a13x From: Alexander Best To: bug-followup@freebsd.org Cc: Subject: Re: bin/144521: [geom] geom(8) tool parsing non-subclass command broken Date: Mon, 20 Sep 2010 22:47:11 +0000 i've thought about this a bit and i think the current semantic is correct. `geom --help` should in fact return: usage: geom --help help geom --help list [name ...] geom --help status [-s] [name ...] geom --help load [-v] geom --help unload [-v] the reason is that although '--help' is not a class at the moment there might be a '--help.ko' somewhere. using 'geom --help load' one could load that module. the geom manual states that the other commands are only available if the class exists. cheers. alex -- a13x State-Changed-From-To: feedback->closed State-Changed-By: arundel State-Changed-When: Mon Oct 18 00:12:33 UTC 2010 State-Changed-Why: I'm closing this PR for the following reason: Taking the current semantics of geom into account this PR doesn't document any bug, but geom's normal behavior. For any sub-class that is not loaded, a standard help output gets generated. although something like 'geom --help help' sure looks strange, it would very well be possible to have geom load "/boot/kernel/geom_--help.ko". Of course one could argue if the current semantics of geom are the best solution, but that should rather be discussed on freebsd-geom@. http://www.freebsd.org/cgi/query-pr.cgi?pr=144521 >Unformatted: