mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-12-26 11:19:32 +03:00
Fix 'zfs list -t snapshot' depth
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
This commit is contained in:
parent
ac4985e48d
commit
c375c69eca
@ -1926,7 +1926,7 @@ zfs_do_get(int argc, char **argv)
|
||||
* 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;
|
||||
@ -3430,7 +3430,7 @@ zfs_do_list(int argc, char **argv)
|
||||
* 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;
|
||||
|
Loading…
Reference in New Issue
Block a user