forked from openzfs/zfs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Always track temporary fses and snapshots for accounting
The root cause of the issue is that we only occasionally do as the comments in the code suggest and actually ignore the %recv dataset when it comes to filesystem limit tracking. Specifically, the only time we ignore it is when initializing the filesystem and snapshot limit values; when creating a new %recv dataset or deleting one, we always update the bookkeeping. This causes a problem if you init the fs count on a filesystem that already has a %recv dataset, since the bookmarking will be decremented but not incremented. This is resolved in this patch by simply always tracking the %recv dataset as a child. Reviewed-by: Matt Ahrens <[email protected]> Reviewed by: Jerry Jelinek <[email protected]> Signed-off-by: Paul Dagnelie <[email protected]> Closes openzfs#10791
- Loading branch information
1 parent
aed82d1
commit 4379692
Showing
4 changed files
with
85 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
77 changes: 77 additions & 0 deletions
77
tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_new_props.ksh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
#!/bin/ksh -p | ||
# | ||
# CDDL HEADER START | ||
# | ||
# This file and its contents are supplied under the terms of the | ||
# Common Development and Distribution License ("CDDL"), version 1.0. | ||
# You may only use this file in accordance with the terms of version | ||
# 1.0 of the CDDL. | ||
# | ||
# A full copy of the text of the CDDL should have accompanied this | ||
# source. A copy of the CDDL is also available via the Internet at | ||
# http://www.illumos.org/license/CDDL. | ||
# | ||
# CDDL HEADER END | ||
# | ||
|
||
# | ||
# Copyright (c) 2020 by Delphix. All rights reserved. | ||
# | ||
|
||
. $STF_SUITE/include/libtest.shlib | ||
|
||
# | ||
# DESCRIPTION: | ||
# ZFS receive test to handle Issue #10698 | ||
# | ||
# STRATEGY: | ||
# 1. Create a pool with filesystem_limits disabled | ||
# 2. Create a filesystem on that pool | ||
# 3. Enable filesystem limits on that pool | ||
# 4. On a pool with filesystem limits enabled, create a filesystem and set a | ||
# limit | ||
# 5. Snapshot limited filesystem | ||
# 6. send -R limited filesystem and receive over filesystem with limits disabled | ||
# | ||
|
||
verify_runnable "both" | ||
|
||
function cleanup | ||
{ | ||
destroy_pool "$poolname" | ||
destroy_pool "$rpoolname" | ||
log_must rm -f "$vdevfile" | ||
log_must rm -f "$rvdevfile" | ||
log_must rm -f "$streamfile" | ||
} | ||
|
||
log_onexit cleanup | ||
|
||
log_assert "ZFS should handle receiving streams with filesystem limits on \ | ||
pools where the feature was recently enabled" | ||
|
||
poolname=sendpool | ||
rpoolname=recvpool | ||
vdevfile="$TEST_BASE_DIR/vdevfile.$$" | ||
rvdevfile="$TEST_BASE_DIR/rvdevfile.$$" | ||
sendfs="$poolname/fs" | ||
recvfs="$rpoolname/rfs" | ||
streamfile="$TEST_BASE_DIR/streamfile.$$" | ||
|
||
log_must truncate -s $MINVDEVSIZE "$rvdevfile" | ||
log_must truncate -s $MINVDEVSIZE "$vdevfile" | ||
log_must zpool create -O mountpoint=none -o feature@filesystem_limits=disabled \ | ||
"$rpoolname" "$rvdevfile" | ||
log_must zpool create -O mountpoint=none "$poolname" "$vdevfile" | ||
|
||
log_must zfs create "$recvfs" | ||
log_must zpool set feature@filesystem_limits=enabled "$rpoolname" | ||
|
||
log_must zfs create -o filesystem_limit=100 "$sendfs" | ||
log_must zfs snapshot "$sendfs@a" | ||
|
||
log_must zfs send -R "$sendfs@a" >"$streamfile" | ||
log_must eval "zfs recv -svuF $recvfs <$streamfile" | ||
|
||
log_pass "ZFS can handle receiving streams with filesystem limits on \ | ||
pools where the feature was recently enabled" |