Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: freenas/freenas
...
head fork: freenas/freenas
  • 2 commits
  • 1 file changed
  • 0 commit comments
  • 2 contributors
Commits on Jun 29, 2013
@noprobs noprobs use native zfs functionality for protecting snaps with clones be57041
@delphij delphij Merge pull request #17 from noprobs/autosnap-clonedelete
Use native zfs functionality for protecting snaps with clones (mark
snapshots for deletion if they can not be deleted right now).
15da659
Showing with 1 addition and 11 deletions.
  1. +1 −11 gui/tools/autosnap.py
View
12 gui/tools/autosnap.py
@@ -192,16 +192,6 @@ def exit_if_running(pid):
else:
snapshots[(fs, snap_ret_policy)] = snap_infodict
-# Exclude snapshots that have clones associated from being deleted
-if len(snapshots_pending_delete) > 0:
- snapshots_cloned = set()
- zfsproc = pipeopen("/sbin/zfs list -H -t filesystem,volume -o origin", debug, logger=log)
- lines = zfsproc.communicate()[0].split('\n')
- for snapshot_name in lines:
- if snapshot_name != '-':
- snapshots_cloned.add(snapshot_name)
- snapshots_pending_delete = snapshots_pending_delete.difference(snapshots_cloned)
-
list_mp = mp_to_task_map.keys()
for mpkey in list_mp:
@@ -253,7 +243,7 @@ def exit_if_running(pid):
if output != '':
fsname, attrname, value, source = output.split('\n')[0].split('\t')
if value == '-':
- snapcmd = '/sbin/zfs destroy -r %s' % (snapshot)
+ snapcmd = '/sbin/zfs destroy -r -d %s' % (snapshot) #snapshots with clones will have destruction deferred
proc = pipeopen(snapcmd, logger=log)
err = proc.communicate()[1]
if proc.returncode != 0:

No commit comments for this range

Something went wrong with that request. Please try again.