Skip to content

Commit 658fb80

Browse files
authored
Add "compatibility" property for zpool feature sets
Property to allow sets of features to be specified; for compatibility with specific versions / releases / external systems. Influences the behavior of 'zpool upgrade' and 'zpool create'. Initial man page changes and test cases included. Brief synopsis: zpool create -o compatibility=off|legacy|file[,file...] pool vdev... compatibility = off : disable compatibility mode (enable all features) compatibility = legacy : request that no features be enabled compatibility = file[,file...] : read features from specified files. Only features present in *all* files will be enabled on the resulting pool. Filenames may be absolute, or relative to /etc/zfs/compatibility.d or /usr/share/zfs/compatibility.d (/etc checked first). Only affects zpool create, zpool upgrade and zpool status. ABI changes in libzfs: * New function "zpool_load_compat" to load and parse compat sets. * Add "zpool_compat_status_t" typedef for compatibility parse status. * Add ZPOOL_PROP_COMPATIBILITY to the pool properties enum * Add ZPOOL_STATUS_COMPATIBILITY_ERR to the pool status enum An initial set of base compatibility sets are included in cmd/zpool/compatibility.d, and the Makefile for cmd/zpool is modified to install these in $pkgdatadir/compatibility.d and to create symbolic links to a reasonable set of aliases. Reviewed-by: ericloewe Reviewed-by: Matthew Ahrens <mahrens@delphix.com> Reviewed-by: Richard Laager <rlaager@wiktel.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Colm Buckley <colm@tuatha.org> Closes #11468
1 parent 35ec517 commit 658fb80

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+5493
-2826
lines changed

cmd/zpool/Makefile.am

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ include $(top_srcdir)/config/CppCheck.am
3939
zpoolconfdir = $(sysconfdir)/zfs/zpool.d
4040
zpoolexecdir = $(zfsexecdir)/zpool.d
4141

42-
EXTRA_DIST = zpool.d/README
42+
EXTRA_DIST = zpool.d/README compatibility.d
4343

4444
dist_zpoolexec_SCRIPTS = \
4545
zpool.d/dm-deps \
@@ -129,10 +129,55 @@ zpoolconfdefaults = \
129129
test_progress \
130130
test_ended
131131

132+
zpoolcompatdir = $(pkgdatadir)/compatibility.d
133+
134+
dist_zpoolcompat_DATA = \
135+
compatibility.d/compat-2018 \
136+
compatibility.d/compat-2019 \
137+
compatibility.d/compat-2020 \
138+
compatibility.d/compat-2021 \
139+
compatibility.d/freebsd-11.0 \
140+
compatibility.d/freebsd-11.2 \
141+
compatibility.d/freebsd-11.3 \
142+
compatibility.d/freenas-9.10.2 \
143+
compatibility.d/grub2 \
144+
compatibility.d/openzfsonosx-1.7.0 \
145+
compatibility.d/openzfsonosx-1.8.1 \
146+
compatibility.d/openzfsonosx-1.9.3 \
147+
compatibility.d/openzfs-2.0-freebsd \
148+
compatibility.d/openzfs-2.0-linux \
149+
compatibility.d/zol-0.6.5 \
150+
compatibility.d/zol-0.7 \
151+
compatibility.d/zol-0.8
152+
153+
# canonical <- alias symbolic link pairs
154+
# eg: "2018" is a link to "compat-2018"
155+
zpoolcompatlinks = \
156+
"compat-2018 2018" \
157+
"compat-2019 2019" \
158+
"compat-2020 2020" \
159+
"compat-2021 2021" \
160+
"freebsd-11.0 freebsd-11.1" \
161+
"freebsd-11.0 freenas-11.0" \
162+
"freebsd-11.2 freenas-11.2" \
163+
"freebsd-11.3 freebsd-11.4" \
164+
"freebsd-11.3 freebsd-12.0" \
165+
"freebsd-11.3 freebsd-12.1" \
166+
"freebsd-11.3 freebsd-12.2" \
167+
"freebsd-11.3 freenas-11.3" \
168+
"freenas-11.0 freenas-11.1" \
169+
"openzfsonosx-1.9.3 openzfsonosx-1.9.4" \
170+
"openzfs-2.0-freebsd truenas-12.0" \
171+
"zol-0.7 ubuntu-18.04" \
172+
"zol-0.8 ubuntu-20.04"
173+
132174
install-data-hook:
133175
$(MKDIR_P) "$(DESTDIR)$(zpoolconfdir)"
134176
for f in $(zpoolconfdefaults); do \
135177
test -f "$(DESTDIR)$(zpoolconfdir)/$${f}" -o \
136178
-L "$(DESTDIR)$(zpoolconfdir)/$${f}" || \
137179
ln -s "$(zpoolexecdir)/$${f}" "$(DESTDIR)$(zpoolconfdir)"; \
138180
done
181+
for l in $(zpoolcompatlinks); do \
182+
(cd "$(DESTDIR)$(zpoolcompatdir)"; ln -s $${l} ); \
183+
done

cmd/zpool/compatibility.d/compat-2018

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Features supported by all Tier 1 platforms as of 2018
2+
async_destroy
3+
bookmarks
4+
embedded_data
5+
empty_bpobj
6+
enabled_txg
7+
extensible_dataset
8+
filesystem_limits
9+
hole_birth
10+
large_blocks
11+
lz4_compress
12+
spacemap_histogram

cmd/zpool/compatibility.d/compat-2019

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Features supported by all Tier 1 platforms as of 2019
2+
async_destroy
3+
bookmarks
4+
embedded_data
5+
empty_bpobj
6+
enabled_txg
7+
extensible_dataset
8+
filesystem_limits
9+
hole_birth
10+
large_blocks
11+
lz4_compress
12+
multi_vdev_crash_dump
13+
sha512
14+
skein
15+
spacemap_histogram

cmd/zpool/compatibility.d/compat-2020

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Features supported by all Tier 1 platforms as of 2020
2+
async_destroy
3+
bookmarks
4+
embedded_data
5+
empty_bpobj
6+
enabled_txg
7+
extensible_dataset
8+
filesystem_limits
9+
hole_birth
10+
large_blocks
11+
lz4_compress
12+
multi_vdev_crash_dump
13+
sha512
14+
skein
15+
spacemap_histogram

cmd/zpool/compatibility.d/compat-2021

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Features supported by all Tier 1 platforms as of 2021
2+
async_destroy
3+
bookmarks
4+
device_removal
5+
embedded_data
6+
empty_bpobj
7+
enabled_txg
8+
extensible_dataset
9+
filesystem_limits
10+
hole_birth
11+
large_blocks
12+
lz4_compress
13+
multi_vdev_crash_dump
14+
obsolete_counts
15+
sha512
16+
skein
17+
spacemap_histogram
18+
spacemap_v2
19+
zpool_checkpoint
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Features supported by FreeBSD 11.0
2+
async_destroy
3+
bookmarks
4+
embedded_data
5+
empty_bpobj
6+
enabled_txg
7+
extensible_dataset
8+
filesystem_limits
9+
hole_birth
10+
large_blocks
11+
lz4_compress
12+
multi_vdev_crash_dump
13+
sha512
14+
skein
15+
spacemap_histogram
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Features supported by FreeBSD 11.2
2+
async_destroy
3+
bookmarks
4+
device_removal
5+
embedded_data
6+
empty_bpobj
7+
enabled_txg
8+
extensible_dataset
9+
filesystem_limits
10+
hole_birth
11+
large_blocks
12+
lz4_compress
13+
multi_vdev_crash_dump
14+
obsolete_counts
15+
sha512
16+
skein
17+
spacemap_histogram
18+
zpool_checkpoint
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Features supported by FreeBSD 11.3
2+
async_destroy
3+
bookmarks
4+
device_removal
5+
embedded_data
6+
empty_bpobj
7+
enabled_txg
8+
extensible_dataset
9+
filesystem_limits
10+
hole_birth
11+
large_blocks
12+
lz4_compress
13+
multi_vdev_crash_dump
14+
obsolete_counts
15+
sha512
16+
skein
17+
spacemap_histogram
18+
spacemap_v2
19+
zpool_checkpoint
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Features supported by FreeNAS 9.10.2
2+
async_destroy
3+
bookmarks
4+
embedded_data
5+
empty_bpobj
6+
enabled_txg
7+
extensible_dataset
8+
filesystem_limits
9+
hole_birth
10+
large_blocks
11+
lz4_compress
12+
multi_vdev_crash_dump
13+
spacemap_histogram

cmd/zpool/compatibility.d/grub2

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Features which are supported by GRUB2
2+
async_destroy
3+
bookmarks
4+
embedded_data
5+
empty_bpobj
6+
enabled_txg
7+
extensible_dataset
8+
filesystem_limits
9+
hole_birth
10+
large_blocks
11+
lz4_compress
12+
spacemap_histogram

0 commit comments

Comments
 (0)