Commit
df583073 introduced the ability to list the snapshots for a
specified dataset. This change inadvertently resulted in only the top-
level snapshots being listed when no dataset was specified. Fix this
issue by adding an additional check to determine if a dataset was
provided to avoid incorrectly restricting the depth.
Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: Tom Caputi <tcaputi@datto.com>
Reviewed-by: Alek Pinchuk <apinchuk@datto.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #8591
Closes #8594
* Handle users who want to get all snapshots of the current
* dataset (ex. 'zfs get -t snapshot refer <dataset>').
*/
- if (types == ZFS_TYPE_SNAPSHOT &&
+ if (types == ZFS_TYPE_SNAPSHOT && argc > 1 &&
(flags & ZFS_ITER_RECURSE) == 0 && limit == 0) {
flags |= (ZFS_ITER_DEPTH_LIMIT | ZFS_ITER_RECURSE);
limit = 1;
* Handle users who want to list all snapshots of the current
* dataset (ex. 'zfs list -t snapshot <dataset>').
*/
- if (types == ZFS_TYPE_SNAPSHOT &&
+ if (types == ZFS_TYPE_SNAPSHOT && argc > 0 &&
(flags & ZFS_ITER_RECURSE) == 0 && limit == 0) {
flags |= (ZFS_ITER_DEPTH_LIMIT | ZFS_ITER_RECURSE);
limit = 1;