From darrenm@sac.sfbay.sun.com Thu Mar 12 04:12:22 2009
Received: from sunmail4.singapore.sun.com (sunmail4.Singapore.Sun.COM [129.158.71.19])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id n2CBCLmJ021335
	for <psarc-ext@sac.sfbay.sun.com>; Thu, 12 Mar 2009 04:12:22 -0700 (PDT)
Received: from brm-avmta-1.central.sun.com (brm-avmta-1.Central.Sun.COM [129.147.4.11])
	by sunmail4.singapore.sun.com (8.13.4+Sun/8.13.3/ENSMAIL,v2.2) with ESMTP id n2CBC6E7014721;
	Thu, 12 Mar 2009 19:12:20 +0800 (SGT)
Received: from pmxchannel-daemon.brm-avmta-1.central.sun.com by
 brm-avmta-1.central.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0KGE0057V4GKKH00@brm-avmta-1.central.sun.com>; Thu,
 12 Mar 2009 05:12:20 -0600 (MDT)
Received: from dm-sfbay-02.sfbay.sun.com ([129.146.11.31])
 by brm-avmta-1.central.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0KGE00BXT4GI26D0@brm-avmta-1.central.sun.com>; Thu,
 12 Mar 2009 05:12:18 -0600 (MDT)
Received: from sac.sfbay.sun.com (sac.SFBay.Sun.COM [129.146.226.132])
	by dm-sfbay-02.sfbay.sun.com (8.13.8+Sun/8.13.8/ENSMAIL,v2.2)
 with ESMTP id n2CBCHUG022015; Thu, 12 Mar 2009 04:12:17 -0700 (PDT)
Received: from sac.sfbay.sun.com (localhost [127.0.0.1])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id n2CBCD3j020204; Thu,
 12 Mar 2009 04:12:13 -0700 (PDT)
Received: (from darrenm@localhost)
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8/Submit) id n2CBCDJ0020189; Thu,
 12 Mar 2009 04:12:13 -0700 (PDT)
Date: Thu, 12 Mar 2009 04:12:13 -0700 (PDT)
From: Darren J Moffat <darrenm@sac.sfbay.sun.com>
Subject: zfs list -d and zfs get -d [PSARC/2009/171 FastTrack timeout
 03/19/2009]
To: PSARC-ext@sun.com
Cc: chris.gerhard@sun.com
Message-id: <200903121112.n2CBCDJ0020189@sac.sfbay.sun.com>
Content-transfer-encoding: 7BIT
X-PMX-Version: 5.4.1.325704
Status: RO
Content-Length: 4108


Template Version: @(#)sac_nextcase 1.68 02/23/09 SMI
This information is Copyright 2009 Sun Microsystems
1. Introduction
    1.1. Project/Component Working Name:
	 zfs list -d and zfs get -d
    1.2. Name of Document Author/Supplier:
	 Author:  Chris Gerhard
    1.3  Date of This Document:
	12 March, 2009
4. Technical Description

This project proposes a -d flag for both the list and get sub-commands to the zfs command. The -d option would take a single argument of a Natural number that would allow the commands to recurse to a depth equal to that integer from the dataset specified.

$ zfs list rpool
NAME    USED  AVAIL  REFER  MOUNTPOINT
rpool  24.5G  42.5G  29.5K  /rpool
$ zfs list -r rpool
NAME                USED  AVAIL  REFER  MOUNTPOINT
rpool              24.5G  42.5G  29.5K  /rpool
rpool/ROOT         3.47G  42.5G    18K  /rpool/ROOT
rpool/ROOT/zfs103  3.47G  42.5G  3.47G  /
rpool/dump         1.00G  42.5G  1.00G  -
rpool/swap           20G  62.2G   276M  -
$ zfs list -d 1 rpool
NAME         USED  AVAIL  REFER  MOUNTPOINT
rpool       24.5G  42.5G  29.5K  /rpool
rpool/ROOT  3.47G  42.5G    18K  /rpool/ROOT
rpool/dump  1.00G  42.5G  1.00G  -
rpool/swap    20G  62.2G   276M  -
$

The most common use for the flag would be to allow the listing of all the snapshots of a dataset:

: exdev.eu FSS 3 $; ./zfs list -d 1 -t snapshot rpool
NAME                                            USED  AVAIL  REFER MOUNTPOINT
rpool@zfs-auto-snap:weekly-2008-10-20-14:34        0      -    36K  -
rpool@zfs-auto-snap:daily-2008-10-20-14:34         0      -    36K  -
rpool@zfs-auto-snap:daily-2008-10-21-00:00       17K      -    36K  -
rpool@zfs-auto-snap:weekly-2008-10-22-00:00        0      -    41K  -
rpool@zfs-auto-snap:daily-2008-10-22-00:00         0      -    41K  -
rpool@zfs-auto-snap:hourly-2008-10-22-16:00        0      -    41K  -
rpool@zfs-auto-snap:hourly-2008-10-22-17:00        0      -    41K  -
rpool@zfs-auto-snap:hourly-2008-10-22-18:00        0      -    41K  -
rpool@zfs-auto-snap:hourly-2008-10-22-19:00        0      -    41K  -
rpool@zfs-auto-snap:hourly-2008-10-22-20:00        0      -    41K  -
rpool@zfs-auto-snap:hourly-2008-10-22-21:00        0      -    41K  -
rpool@zfs-auto-snap:hourly-2008-10-22-22:00        0      -    41K  -
rpool@zfs-auto-snap:hourly-2008-10-22-23:00        0      -    41K  -
rpool@zfs-auto-snap:hourly-2008-10-23-00:00        0      -    41K  -
rpool@zfs-auto-snap:daily-2008-10-23-00:00         0      -    41K  -
rpool@zfs-auto-snap:hourly-2008-10-23-01:00        0      -    41K  -
rpool@zfs-auto-snap:hourly-2008-10-23-02:00        0      -    41K  -
rpool@zfs-auto-snap:hourly-2008-10-23-03:00        0      -    41K  -
rpool@zfs-auto-snap:hourly-2008-10-23-04:00        0      -    41K  -
rpool@zfs-auto-snap:hourly-2008-10-23-05:00        0      -    41K  -
rpool@zfs-auto-snap:hourly-2008-10-23-06:00        0      -    41K  -
rpool@zfs-auto-snap:hourly-2008-10-23-07:00        0      -    41K  -
rpool@zfs-auto-snap:hourly-2008-10-23-08:00        0      -    41K  -
rpool@zfs-auto-snap:hourly-2008-10-23-09:00        0      -    41K  -
rpool@zfs-auto-snap:hourly-2008-10-23-10:00        0      -    41K  -
rpool@zfs-auto-snap:hourly-2008-10-23-11:00        0      -    41K  -
rpool@zfs-auto-snap:hourly-2008-10-23-12:00        0      -    41K  -
rpool@zfs-auto-snap:hourly-2008-10-23-13:00        0      -    41K  -
rpool@zfs-auto-snap:hourly-2008-10-23-14:00        0      -    41K  -
rpool@zfs-auto-snap:frequent-2008-10-23-14:15      0      -    41K  -
rpool@zfs-auto-snap:frequent-2008-10-23-14:30      0      -    41K  -
rpool@zfs-auto-snap:frequent-2008-10-23-14:45      0      -    41K  -
: exdev.eu FSS 4 $;

Use of the -d and -r options would be mutually exclusive and result in a usage error. Giving a negative depth or a non numeric depth would also result in an error.


Updated man pages are in the case materials directory.

6. Resources and Schedule
    6.4. Steering Committee requested information
       6.4.1. Consolidation C-team Name:
        ON
    6.5. ARC review type: FastTrack
    6.6. ARC Exposure: open

From carlsonj@phorcys.east.sun.com Thu Mar 12 04:48:03 2009
Received: from sunmail5.uk.sun.com (sunmail5.UK.Sun.COM [129.156.85.165])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id n2CBm2qP004026
	for <psarc-ext@sac.sfbay.sun.com>; Thu, 12 Mar 2009 04:48:03 -0700 (PDT)
Received: from nwk-avmta-2.sfbay.sun.com (nwk-avmta-2.SFBay.Sun.COM [129.145.155.6])
	by sunmail5.uk.sun.com (8.13.8+Sun/8.13.8/ENSMAIL,v2.2) with ESMTP id n2CBluKQ013001;
	Thu, 12 Mar 2009 11:48:02 GMT
Received: from pmxchannel-daemon.nwk-avmta-2.sfbay.sun.com by
 nwk-avmta-2.sfbay.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0KGE00I0163ZMM00@nwk-avmta-2.sfbay.sun.com>; Thu,
 12 Mar 2009 04:47:59 -0700 (PDT)
Received: from phorcys.east.sun.com ([129.148.174.143])
 by nwk-avmta-2.sfbay.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0KGE009LM63YLUA0@nwk-avmta-2.sfbay.sun.com>; Thu,
 12 Mar 2009 04:47:58 -0700 (PDT)
Received: from phorcys.east.sun.com (localhost [127.0.0.1])
	by phorcys.east.sun.com (8.14.3+Sun/8.14.3) with ESMTP id n2CBlsvY002393; Thu,
 12 Mar 2009 07:47:54 -0400 (EDT)
Received: (from carlsonj@localhost)
	by phorcys.east.sun.com (8.14.3+Sun/8.14.3/Submit) id n2CBlsYc002390; Thu,
 12 Mar 2009 07:47:54 -0400 (EDT)
Date: Thu, 12 Mar 2009 07:47:54 -0400
From: James Carlson <james.d.carlson@sun.com>
Subject: Re: zfs list -d and zfs get -d [PSARC/2009/171 FastTrack timeout
	03/19/2009]
In-reply-to: <200903121112.n2CBCDJ0020189@sac.sfbay.sun.com>
To: Darren J Moffat <darrenm@sac.sfbay.sun.com>
Cc: PSARC-ext@sun.com, Chris.Gerhard@sun.com
Message-id: <18872.63082.283003.339306@gargle.gargle.HOWL>
MIME-version: 1.0
X-Mailer: VM 7.01 under Emacs 21.3.1
Content-type: text/plain; charset=us-ascii
Content-transfer-encoding: 7BIT
X-PMX-Version: 5.4.1.325704
References: <200903121112.n2CBCDJ0020189@sac.sfbay.sun.com>
Status: RO
Content-Length: 577

Darren J Moffat writes:
> This project proposes a -d flag for both the list and get sub-commands to the zfs command. The -d option would take a single argument of a Natural number that would allow the commands to recurse to a depth equal to that integer from the dataset specified.

Assuming "patch/micro" release binding and "Committed" stability, +1.

-- 
James Carlson, Solaris Networking              <james.d.carlson@sun.com>
Sun Microsystems / 35 Network Drive        71.232W   Vox +1 781 442 2084
MS UBUR02-212 / Burlington MA 01803-2757   42.496N   Fax +1 781 442 1677

From Darren.Moffat@sun.com Thu Mar 12 05:11:33 2009
Received: from sunmail3mpk.sfbay.sun.com (sunmail3mpk.SFBay.Sun.COM [129.146.11.52])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id n2CCBXIU004555
	for <psarc-ext@sac.sfbay.sun.com>; Thu, 12 Mar 2009 05:11:33 -0700 (PDT)
Received: from nwk-avmta-1.SFBay.Sun.COM (nwk-avmta-1.SFBay.Sun.COM [129.146.11.74])
	by sunmail3mpk.sfbay.sun.com (8.13.7+Sun/8.13.7/ENSMAIL,v2.2) with ESMTP id n2CCBVAu023373
	for <@sunmail2sca.sfbay.sun.com:PSARC-ext@sun.com>; Thu, 12 Mar 2009 05:11:33 -0700 (PDT)
Received: from pmxchannel-daemon.nwk-avmta-1.sfbay.Sun.COM by
 nwk-avmta-1.sfbay.Sun.COM
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0KGE00E0R778A900@nwk-avmta-1.sfbay.Sun.COM> for PSARC-ext@sun.com
 (ORCPT PSARC-ext@Sun.Com); Thu, 12 Mar 2009 05:11:32 -0700 (PDT)
Received: from gmp-eb-inf-2.sun.com ([192.18.6.24])
 by nwk-avmta-1.sfbay.Sun.COM
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0KGE00DM5777DA90@nwk-avmta-1.sfbay.Sun.COM> for
 PSARC-ext@sun.com (ORCPT PSARC-ext@Sun.Com); Thu,
 12 Mar 2009 05:11:31 -0700 (PDT)
Received: from fe-emea-09.sun.com (gmp-eb-lb-2-fe2.eu.sun.com [192.18.6.11])
	by gmp-eb-inf-2.sun.com (8.13.7+Sun/8.12.9) with ESMTP id n2CCBUwT019007	for
 <PSARC-ext@Sun.Com>; Thu, 12 Mar 2009 12:11:30 +0000 (GMT)
Received: from conversion-daemon.fe-emea-09.sun.com by fe-emea-09.sun.com
 (Sun Java(tm) System Messaging Server 7.0-5.01 64bit (built Feb 19 2009))
 id <0KGE004006RUR800@fe-emea-09.sun.com> for PSARC-ext@Sun.Com
 (ORCPT PSARC-ext@Sun.Com); Thu, 12 Mar 2009 12:11:30 +0000 (GMT)
Received: from [129.156.173.21] ([unknown] [129.156.173.21])
 by fe-emea-09.sun.com
 (Sun Java(tm) System Messaging Server 7.0-5.01 64bit (built Feb 19 2009))
 with ESMTPSA id <0KGE001CM773CC80@fe-emea-09.sun.com>; Thu,
 12 Mar 2009 12:11:28 +0000 (GMT)
Date: Thu, 12 Mar 2009 12:11:27 +0000
From: Darren J Moffat <Darren.Moffat@sun.com>
Subject: Re: zfs list -d and zfs get -d [PSARC/2009/171 FastTrack timeout
 03/19/2009]
In-reply-to: <18872.63082.283003.339306@gargle.gargle.HOWL>
Sender: Darren.Moffat@sun.com
To: James Carlson <James.D.Carlson@sun.com>
Cc: Darren J Moffat <darrenm@sac.sfbay.sun.com>, PSARC-ext@sun.com,
        Chris.Gerhard@sun.com
Message-id: <49B8FBEF.70206@Sun.COM>
MIME-version: 1.0
Content-type: text/plain; format=flowed; charset=ISO-8859-1
Content-transfer-encoding: 7BIT
X-PMX-Version: 5.4.1.325704
References: <200903121112.n2CBCDJ0020189@sac.sfbay.sun.com>
 <18872.63082.283003.339306@gargle.gargle.HOWL>
User-Agent: Thunderbird 2.0.0.18 (X11/20081201)
Status: RO
Content-Length: 416

James Carlson wrote:
> Darren J Moffat writes:
>> This project proposes a -d flag for both the list and get sub-commands to the zfs command. The -d option would take a single argument of a Natural number that would allow the commands to recurse to a depth equal to that integer from the dataset specified.
> 
> Assuming "patch/micro" release binding and "Committed" stability, +1.

yes and yes.

-- 
Darren J Moffat

From Scott.Rotondo@Sun.COM Thu Mar 12 11:17:08 2009
Received: from sunmail5.uk.sun.com (sunmail5.UK.Sun.COM [129.156.85.165])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id n2CIH7qM015711
	for <psarc-ext@sac.sfbay.sun.com>; Thu, 12 Mar 2009 11:17:08 -0700 (PDT)
Received: from nwk-avmta-1.SFBay.Sun.COM (nwk-avmta-1.SFBay.Sun.COM [129.146.11.74])
	by sunmail5.uk.sun.com (8.13.8+Sun/8.13.8/ENSMAIL,v2.2) with ESMTP id n2CIH3I1020688
	for <@sunmail2sca.sfbay.sun.com:PSARC-ext@sun.com>; Thu, 12 Mar 2009 18:17:07 GMT
Received: from pmxchannel-daemon.nwk-avmta-1.sfbay.Sun.COM by
 nwk-avmta-1.sfbay.Sun.COM
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0KGE0058RO4HDY00@nwk-avmta-1.sfbay.Sun.COM> for PSARC-ext@sun.com
 (ORCPT PSARC-ext@sun.com); Thu, 12 Mar 2009 11:17:05 -0700 (PDT)
Received: from brmea-mail-1.sun.com ([192.18.98.31])
 by nwk-avmta-1.sfbay.Sun.COM
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0KGE00456O3S8B10@nwk-avmta-1.sfbay.Sun.COM> for
 PSARC-ext@sun.com (ORCPT PSARC-ext@sun.com); Thu,
 12 Mar 2009 11:16:40 -0700 (PDT)
Received: from fe-amer-10.sun.com ([192.18.109.80])
	by brmea-mail-1.sun.com (8.13.6+Sun/8.12.9) with ESMTP id n2CIGeUH008303	for
 <PSARC-ext@sun.com>; Thu, 12 Mar 2009 18:16:40 +0000 (GMT)
Received: from conversion-daemon.mail-amer.sun.com by mail-amer.sun.com
 (Sun Java(tm) System Messaging Server 7.0-5.01 64bit (built Feb 19 2009))
 id <0KGE00C00NGFMK00@mail-amer.sun.com> for PSARC-ext@sun.com
 (ORCPT PSARC-ext@sun.com); Thu, 12 Mar 2009 12:16:40 -0600 (MDT)
Received: from [129.146.108.62] ([unknown] [129.146.108.62])
 by mail-amer.sun.com
 (Sun Java(tm) System Messaging Server 7.0-5.01 64bit (built Feb 19 2009))
 with ESMTPSA id <0KGE00JY5O3EU7A0@mail-amer.sun.com>; Thu,
 12 Mar 2009 12:16:27 -0600 (MDT)
Date: Thu, 12 Mar 2009 11:16:26 -0700
From: Scott Rotondo <Scott.Rotondo@Sun.COM>
Subject: Re: zfs list -d and zfs get -d [PSARC/2009/171 FastTrack timeout
 03/19/2009]
In-reply-to: <200903121112.n2CBCDJ0020189@sac.sfbay.sun.com>
Sender: Scott.Rotondo@Sun.COM
To: Darren J Moffat <darrenm@sac.sfbay.sun.com>
Cc: PSARC-ext@Sun.COM, Chris.Gerhard@Sun.COM
Message-id: <49B9517A.5020404@sun.com>
MIME-version: 1.0
Content-type: text/plain; format=flowed; charset=ISO-8859-1
Content-transfer-encoding: 7BIT
X-PMX-Version: 5.4.1.325704
References: <200903121112.n2CBCDJ0020189@sac.sfbay.sun.com>
User-Agent: Thunderbird 2.0.0.12 (X11/20080422)
Status: RO
Content-Length: 2030

Darren J Moffat wrote:
> Template Version: @(#)sac_nextcase 1.68 02/23/09 SMI
> This information is Copyright 2009 Sun Microsystems
> 1. Introduction
>     1.1. Project/Component Working Name:
> 	 zfs list -d and zfs get -d
>     1.2. Name of Document Author/Supplier:
> 	 Author:  Chris Gerhard
>     1.3  Date of This Document:
> 	12 March, 2009
> 4. Technical Description
> 
> This project proposes a -d flag for both the list and get sub-commands to the zfs command. The -d option would take a single argument of a Natural number that would allow the commands to recurse to a depth equal to that integer from the dataset specified.
> 
> $ zfs list rpool
> NAME    USED  AVAIL  REFER  MOUNTPOINT
> rpool  24.5G  42.5G  29.5K  /rpool
> $ zfs list -r rpool
> NAME                USED  AVAIL  REFER  MOUNTPOINT
> rpool              24.5G  42.5G  29.5K  /rpool
> rpool/ROOT         3.47G  42.5G    18K  /rpool/ROOT
> rpool/ROOT/zfs103  3.47G  42.5G  3.47G  /
> rpool/dump         1.00G  42.5G  1.00G  -
> rpool/swap           20G  62.2G   276M  -
> $ zfs list -d 1 rpool
> NAME         USED  AVAIL  REFER  MOUNTPOINT
> rpool       24.5G  42.5G  29.5K  /rpool
> rpool/ROOT  3.47G  42.5G    18K  /rpool/ROOT
> rpool/dump  1.00G  42.5G  1.00G  -
> rpool/swap    20G  62.2G   276M  -
> $
> 

This is a minor quibble, but I was surprised to see that -d is a 
replacement for -r instead of an option that modifies its behavior. In 
other words, I would have expected the example above to be

$ zfs list -r -d 1 rpool

for consistency with the way the other zfs list modifiers work. On the 
other hand, I can't see why you would use -d without -r, and your syntax 
will save a few keystrokes.

At the very least, you might want to silently allow the combination of 
-r and -d without generating an error. That will help anyone who thinks 
of -d as a modifier instead of an action.

	Scott

-- 
Scott Rotondo
Principal Engineer, Solaris Security Technologies
President, Trusted Computing Group
Phone/FAX: +1 408 850 3655 (Internal x68278)

