Feature #1644

add ZFS "clones" property

Added by Matthew Ahrens about 6 years ago. Updated about 6 years ago.

Status:ResolvedStart date:2011-10-14
Priority:NormalDue date:
Assignee:Matthew Ahrens% Done:

0%

Category:zfs - Zettabyte File System
Target version:-
Difficulty:Medium Tags:needs-triage

Description

Add a ZFS property to get the clones of a snapshot.

zfs(1m) manpage additions:

clones

For snapshots, this property is a comma-separated list
of filesystems or volumes which are clones of this
snapshot. The clones' origin property is this snapshot.
If the clones property is not empty, then this snapshot
can not be destroyed (even with the -r or -f options).

example:

$ zfs list -t all -o name,origin,clones
NAME                                                            ORIGIN                                                          CLONES
...
ws/delphix-gate-old@c                                           -                                                               ws/new2,ws/new
ws/new                                                          ws/delphix-gate-old@c                                           -
ws/new2                                                         ws/delphix-gate-old@c                                           -

History

#1 Updated by Eric Schrock about 6 years ago

  • Status changed from New to Resolved

changeset: 13509:04570f5cbeca
tag: tip
user: Matthew Ahrens <>
date: Sat Nov 05 17:34:13 2011 -0700

description:
1644 add ZFS "clones" property
1645 add ZFS "written" and "written@..." properties
1646 "zfs send" should estimate size of stream
1647 "zfs destroy" should determine space reclaimed by destroying multiple snapshots
1708 adjust size of zpool history data
Reviewed by: Richard Lowe <>
Reviewed by: George Wilson <>
Approved by: Gordon Ross <>

modified:
usr/src/cmd/truss/codes.c
usr/src/cmd/zfs/zfs_main.c
usr/src/cmd/zoneadmd/Makefile
usr/src/common/zfs/zfs_prop.c
usr/src/lib/libzfs/Makefile.com
usr/src/lib/libzfs/common/libzfs.h
usr/src/lib/libzfs/common/libzfs_dataset.c
usr/src/lib/libzfs/common/libzfs_impl.h
usr/src/lib/libzfs/common/libzfs_sendrecv.c
usr/src/lib/libzfs/common/libzfs_util.c
usr/src/lib/libzfs/common/mapfile-vers
usr/src/man/man1m/zfs.1m
usr/src/uts/Makefile.uts
usr/src/uts/common/fs/zfs/bpobj.c
usr/src/uts/common/fs/zfs/dmu_send.c
usr/src/uts/common/fs/zfs/dsl_dataset.c
usr/src/uts/common/fs/zfs/dsl_deadlist.c
usr/src/uts/common/fs/zfs/dsl_deleg.c
usr/src/uts/common/fs/zfs/dsl_pool.c
usr/src/uts/common/fs/zfs/spa_history.c
usr/src/uts/common/fs/zfs/sys/dmu.h
usr/src/uts/common/fs/zfs/sys/dsl_dataset.h
usr/src/uts/common/fs/zfs/sys/dsl_deleg.h
usr/src/uts/common/fs/zfs/zap_micro.c
usr/src/uts/common/fs/zfs/zfs_ioctl.c
usr/src/uts/common/sys/fs/zfs.h
added:
usr/src/lib/libzfs/common/libzfs_iter.c
removed:
usr/src/lib/libzfs/common/libzfs_graph.c

#2 Updated by Rich Lowe about 6 years ago

  • Status changed from Resolved to In Progress

Backed out by r13511 commit:4bd28e91c699

Broke snapshots, BEs, possibly other things.

#3 Updated by Stepan Zastupov about 6 years ago

Just stumbled upon the bug cause by these changes:

openindiana ~ % sudo zfs create rpool/export/zones                
cannot create 'rpool/export/zones': no such pool 'rpoo'

That's because s/strncpy/strlcpy/ in libzfs/common/libzfs_dataset.c wasn't a good idea. For example, parent_name() relies on strncpy() semantics.

#4 Updated by Yuri Pankov about 6 years ago

That's exactly why it was backed out..

#5 Updated by Eric Schrock about 6 years ago

  • Status changed from In Progress to Resolved

changeset: 13524:f0e12b33f77c
tag: tip
user: Matthew Ahrens <>
date: Thu Nov 17 10:14:36 2011 -0800

description:
1644 add ZFS "clones" property
1645 add ZFS "written" and "written@..." properties
1646 "zfs send" should estimate size of stream
1647 "zfs destroy" should determine space reclaimed by destroying multiple snapshots
1708 adjust size of zpool history data
Reviewed by: Richard Lowe <>
Reviewed by: George Wilson <>
Reviewed by: Albert Lee <>
Approved by: Garrett D'Amore <>

modified:
usr/src/cmd/ndmpd/ndmp/ndmpd_zfs.c
usr/src/cmd/truss/codes.c
usr/src/cmd/zfs/zfs_main.c
usr/src/common/zfs/zfs_prop.c
usr/src/lib/libbe/common/be_create.c
usr/src/lib/libzfs/Makefile.com
usr/src/lib/libzfs/common/libzfs.h
usr/src/lib/libzfs/common/libzfs_dataset.c
usr/src/lib/libzfs/common/libzfs_impl.h
usr/src/lib/libzfs/common/libzfs_sendrecv.c
usr/src/lib/libzfs/common/libzfs_util.c
usr/src/lib/libzfs/common/mapfile-vers
usr/src/man/man1m/zfs.1m
usr/src/uts/Makefile.uts
usr/src/uts/common/fs/zfs/bpobj.c
usr/src/uts/common/fs/zfs/dmu_send.c
usr/src/uts/common/fs/zfs/dsl_dataset.c
usr/src/uts/common/fs/zfs/dsl_deadlist.c
usr/src/uts/common/fs/zfs/dsl_deleg.c
usr/src/uts/common/fs/zfs/dsl_pool.c
usr/src/uts/common/fs/zfs/spa_history.c
usr/src/uts/common/fs/zfs/sys/dmu.h
usr/src/uts/common/fs/zfs/sys/dsl_dataset.h
usr/src/uts/common/fs/zfs/sys/dsl_deleg.h
usr/src/uts/common/fs/zfs/zap_micro.c
usr/src/uts/common/fs/zfs/zfs_ioctl.c
usr/src/uts/common/sys/fs/zfs.h
added:
usr/src/lib/libzfs/common/libzfs_iter.c
removed:
usr/src/lib/libzfs/common/libzfs_graph.c

Also available in: Atom