aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorKeith M Wesolowski <[email protected]>2013-07-27 10:51:50 -0700
committerBrian Behlendorf <[email protected]>2013-11-04 11:18:14 -0800
commit96c2e961938d4018ddb393fa60e004d8a91a58e9 (patch)
tree6f831e836b96ef81a5daac0ef712df6ac394c492 /cmd
parent1a077756e8ba946a55f999fa1cb5f0e7dcb9aa81 (diff)
Illumos #3894
3894 zfs should not allow snapshot of inconsistent dataset Reviewed by: Matthew Ahrens <[email protected]> Approved by: Gordon Ross <[email protected]> References: https://www.illumos.org/issues/3894 illumos/illumos-gate@ca48f36f20f6098ceb19d5b084b6b3d4b8eca9fa Ported-by: Richard Yao <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Issue #1775
Diffstat (limited to 'cmd')
-rw-r--r--cmd/zfs/zfs_main.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/cmd/zfs/zfs_main.c b/cmd/zfs/zfs_main.c
index 08d16aa1f..fba3e255c 100644
--- a/cmd/zfs/zfs_main.c
+++ b/cmd/zfs/zfs_main.c
@@ -3480,6 +3480,12 @@ zfs_snapshot_cb(zfs_handle_t *zhp, void *arg)
int rv = 0;
int error;
+ if (sd->sd_recursive &&
+ zfs_prop_get_int(zhp, ZFS_PROP_INCONSISTENT) != 0) {
+ zfs_close(zhp);
+ return (0);
+ }
+
error = asprintf(&name, "%s@%s", zfs_get_name(zhp), sd->sd_snapname);
if (error == -1)
nomem();