diff options
author | eschrock <none@none> | 2006-07-31 15:13:30 -0700 |
---|---|---|
committer | eschrock <none@none> | 2006-07-31 15:13:30 -0700 |
commit | 3bb79bece53191f2cf27aa61a72ea1784a7ce700 (patch) | |
tree | 2ef162103e713655e9e6889a7ac7389d304f7c55 /usr/src/cmd/zfs/zfs_main.c | |
parent | 79033acb8a0c499540c5c46e165cff4ccc2ebf59 (diff) | |
download | illumos-gate-3bb79bece53191f2cf27aa61a72ea1784a7ce700.tar.gz |
6368751 libzfs interface for mount/umounting all the file systems for a given pool
6385349 zpool import -d /dev hangs
6397052 unmounting datasets should process /etc/mnttab instead of traverse DSL
6403510 zfs remount,noatime option broken
6423412 Two spaces lines are unnecessary after 'zpool import -a'
6434054 'zfs destroy' core dumps if clone is namespace-parent of origin
6440515 namespace_reload() can leak memory on allocation faiure
6440592 nvlist_dup() should not fill in destination pointer on error
6446060 zfs get does not consistently report temporary properties
6448326 zfs(1) 'list' command crashes if hidden property createtxg is requested
6450653 get_dependents() has poor error semantics
--HG--
rename : usr/src/cmd/zpool/zpool_dataset.c => deleted_files/usr/src/cmd/zpool/zpool_dataset.c
Diffstat (limited to 'usr/src/cmd/zfs/zfs_main.c')
-rw-r--r-- | usr/src/cmd/zfs/zfs_main.c | 43 |
1 files changed, 30 insertions, 13 deletions
diff --git a/usr/src/cmd/zfs/zfs_main.c b/usr/src/cmd/zfs/zfs_main.c index a8b734a933..c88777bc0b 100644 --- a/usr/src/cmd/zfs/zfs_main.c +++ b/usr/src/cmd/zfs/zfs_main.c @@ -609,7 +609,11 @@ destroy_snap_clones(zfs_handle_t *zhp, void *arg) /* * Destroy any clones of this snapshot */ - (void) zfs_iter_dependents(szhp, destroy_callback, cbp); + if (zfs_iter_dependents(szhp, B_FALSE, destroy_callback, + cbp) != 0) { + zfs_close(szhp); + return (-1); + } zfs_close(szhp); } @@ -673,7 +677,10 @@ zfs_do_destroy(int argc, char **argv) if (cb.cb_doclones) { cb.cb_snapname = cp; - (void) destroy_snap_clones(zhp, &cb); + if (destroy_snap_clones(zhp, &cb) != 0) { + zfs_close(zhp); + return (1); + } } ret = zfs_destroy_snaps(zhp, cp); @@ -713,22 +720,28 @@ zfs_do_destroy(int argc, char **argv) * Check for any dependents and/or clones. */ cb.cb_first = B_TRUE; - if (!cb.cb_doclones) - (void) zfs_iter_dependents(zhp, destroy_check_dependent, &cb); + if (!cb.cb_doclones && + zfs_iter_dependents(zhp, B_TRUE, destroy_check_dependent, + &cb) != 0) { + zfs_close(zhp); + return (1); + } + - if (cb.cb_error) { + if (cb.cb_error || + zfs_iter_dependents(zhp, B_FALSE, destroy_callback, &cb) != 0) { zfs_close(zhp); return (1); } /* - * Do the real thing. + * Do the real thing. The callback will close the handle regardless of + * whether it succeeds or not. */ - if (zfs_iter_dependents(zhp, destroy_callback, &cb) == 0 && - destroy_callback(zhp, &cb) == 0) - return (0); + if (destroy_callback(zhp, &cb) != 0) + return (1); - return (1); + return (0); } /* @@ -1514,8 +1527,11 @@ rollback_check(zfs_handle_t *zhp, void *data) if (cbp->cb_recurse) { cbp->cb_dependent = B_TRUE; - (void) zfs_iter_dependents(zhp, rollback_check, - cbp); + if (zfs_iter_dependents(zhp, B_TRUE, + rollback_check, cbp) != 0) { + zfs_close(zhp); + return (-1); + } cbp->cb_dependent = B_FALSE; } else { (void) fprintf(stderr, "%s\n", @@ -1606,7 +1622,8 @@ zfs_do_rollback(int argc, char **argv) cb.cb_create = zfs_prop_get_int(snap, ZFS_PROP_CREATETXG); cb.cb_first = B_TRUE; cb.cb_error = 0; - (void) zfs_iter_children(zhp, rollback_check, &cb); + if ((ret = zfs_iter_children(zhp, rollback_check, &cb)) != 0) + goto out; if ((ret = cb.cb_error) != 0) goto out; |