OpenZFS 2605, 6980, 6902

2605 want to resume interrupted zfs send
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Paul Dagnelie <pcd@delphix.com>
Reviewed by: Richard Elling <Richard.Elling@RichardElling.com>
Reviewed by: Xin Li <delphij@freebsd.org>
Reviewed by: Arne Jansen <sensille@gmx.net>
Approved by: Dan McDonald <danmcd@omniti.com>
Ported-by: kernelOfTruth <kerneloftruth@gmail.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>

OpenZFS-issue: https://www.illumos.org/issues/2605
OpenZFS-commit: https://github.com/openzfs/openzfs/commit/9c3fd12

6980 6902 causes zfs send to break due to 32-bit/64-bit struct mismatch
Reviewed by: Paul Dagnelie <pcd@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Ported by: Brian Behlendorf <behlendorf1@llnl.gov>

OpenZFS-issue: https://www.illumos.org/issues/6980
OpenZFS-commit: https://github.com/openzfs/openzfs/commit/ea4a67f

Porting notes:
- All rsend and snapshop tests enabled and updated for Linux.
- Fix misuse of input argument in traverse_visitbp().
- Fix ISO C90 warnings and errors.
- Fix gcc 'missing braces around initializer' in
  'struct send_thread_arg to_arg =' warning.
- Replace 4 argument fletcher_4_native() with 3 argument version,
  this change was made in OpenZFS 4185 which has not been ported.
- Part of the sections for 'zfs receive' and 'zfs send' was
  rewritten and reordered to approximate upstream.
- Fix mktree xattr creation, 'user.' prefix required.
- Minor fixes to newly enabled test cases
- Long holds for volumes allowed during receive for minor registration.
This commit is contained in:
Matthew Ahrens
2016-01-06 22:22:48 +01:00
committed by Brian Behlendorf
parent 669cf0ab29
commit 47dfff3b86
40 changed files with 1483 additions and 337 deletions
+31 -27
View File
@@ -146,14 +146,13 @@ tests = ['zfs_promote_001_pos', 'zfs_promote_002_pos', 'zfs_promote_003_pos',
tests = []
# DISABLED:
# zfs_receive_003_pos - needs investigation
# zfs_receive_010_pos - needs investigation
# zfs_receive_011_pos - needs investigation
# zfs_receive_012_pos - needs investigation
# zfs_receive_004_neg - Fails for OpenZFS on illumos
# zfs_receive_011_pos - Requires port of OpenZFS 6562
# zfs_receive_012_pos - Requires port of OpenZFS 6562
[tests/functional/cli_root/zfs_receive]
tests = ['zfs_receive_001_pos', 'zfs_receive_002_pos', 'zfs_receive_005_neg',
'zfs_receive_006_pos', 'zfs_receive_007_neg', 'zfs_receive_008_pos',
'zfs_receive_009_neg']
tests = ['zfs_receive_001_pos', 'zfs_receive_002_pos', 'zfs_receive_003_pos',
'zfs_receive_005_neg', 'zfs_receive_006_pos',
'zfs_receive_007_neg', 'zfs_receive_008_pos', 'zfs_receive_009_neg']
# DISABLED:
# zfs_rename_002_pos - needs investigation
@@ -175,11 +174,10 @@ tests = ['zfs_reservation_001_pos', 'zfs_reservation_002_pos']
[tests/functional/cli_root/zfs_rollback]
tests = ['zfs_rollback_003_neg', 'zfs_rollback_004_neg']
# DISABLED:
# zfs_send_007_pos - needs investigation
[tests/functional/cli_root/zfs_send]
tests = ['zfs_send_001_pos', 'zfs_send_002_pos', 'zfs_send_003_pos',
'zfs_send_004_neg', 'zfs_send_005_pos', 'zfs_send_006_pos']
'zfs_send_004_neg', 'zfs_send_005_pos', 'zfs_send_006_pos',
'zfs_send_007_pos']
# DISABLED:
# mountpoint_003_pos - needs investigation
@@ -207,10 +205,11 @@ tests = ['cache_001_pos', 'cache_002_neg', 'canmount_001_pos',
# DISABLED:
# zfs_snapshot_008_neg - nested pools
# zfs_snapshot_009_pos - Fails for OpenZFS on illumos
[tests/functional/cli_root/zfs_snapshot]
tests = ['zfs_snapshot_001_neg', 'zfs_snapshot_002_neg',
'zfs_snapshot_003_neg', 'zfs_snapshot_004_neg', 'zfs_snapshot_005_neg',
'zfs_snapshot_006_pos', 'zfs_snapshot_007_neg', 'zfs_snapshot_009_pos']
'zfs_snapshot_006_pos', 'zfs_snapshot_007_neg']
# DISABLED:
# zfs_unmount_005_pos - needs investigation
@@ -565,12 +564,17 @@ tests = ['reservation_001_pos', 'reservation_002_pos', 'reservation_003_pos',
#[tests/functional/rootpool]
#tests = ['rootpool_002_neg', 'rootpool_003_neg', 'rootpool_007_neg']
# DISABLED: Hangs on I/O for unclear reason.
#[tests/functional/rsend]
#tests = ['rsend_002_pos', 'rsend_003_pos', 'rsend_004_pos',
# 'rsend_005_pos', 'rsend_006_pos', 'rsend_007_pos', 'rsend_008_pos',
# 'rsend_009_pos', 'rsend_010_pos', 'rsend_011_pos', 'rsend_012_pos',
# 'rsend_013_pos']
# DISABLED:
# rsend_008_pos - Fails for OpenZFS on illumos
# rsend_009_pos - Fails for OpenZFS on illumos
# rsend_020_pos - ASSERTs in dump_record()
[tests/functional/rsend]
tests = ['rsend_001_pos', 'rsend_002_pos', 'rsend_003_pos', 'rsend_004_pos',
'rsend_005_pos', 'rsend_006_pos', 'rsend_007_pos',
'rsend_010_pos', 'rsend_011_pos', 'rsend_012_pos',
'rsend_013_pos', 'rsend_014_pos',
'rsend_019_pos',
'rsend_021_pos', 'rsend_022_pos', 'rsend_024_pos']
[tests/functional/scrub_mirror]
tests = ['scrub_mirror_001_pos', 'scrub_mirror_002_pos',
@@ -586,17 +590,17 @@ tests = ['slog_001_pos', 'slog_002_pos', 'slog_003_pos', 'slog_004_pos',
'slog_009_neg', 'slog_010_neg', 'slog_011_neg']
# DISABLED:
# clone_001_pos - nested pools
# rollback_003_pos - Hangs in unmount and spins.
# snapshot_013_pos - Hangs on I/O for unclear reason.
# snapshot_016_pos - .zfs mv/rmdir/mkdir disabled by default.
#[tests/functional/snapshot]
#tests = ['clone_001_pos', 'rollback_001_pos', 'rollback_002_pos',
# 'snapshot_001_pos', 'snapshot_002_pos',
# 'snapshot_003_pos', 'snapshot_004_pos', 'snapshot_005_pos',
# 'snapshot_006_pos', 'snapshot_007_pos', 'snapshot_008_pos',
# 'snapshot_009_pos', 'snapshot_010_pos', 'snapshot_011_pos',
# 'snapshot_012_pos', 'snapshot_014_pos',
# 'snapshot_015_pos', 'snapshot_017_pos']
# snapshot_016_pos - Problem with automount
[tests/functional/snapshot]
tests = ['rollback_001_pos', 'rollback_002_pos',
'snapshot_001_pos', 'snapshot_002_pos',
'snapshot_003_pos', 'snapshot_004_pos', 'snapshot_005_pos',
'snapshot_006_pos', 'snapshot_007_pos', 'snapshot_008_pos',
'snapshot_009_pos', 'snapshot_010_pos', 'snapshot_011_pos',
'snapshot_012_pos', 'snapshot_013_pos', 'snapshot_014_pos',
'snapshot_015_pos', 'snapshot_017_pos']
[tests/functional/snapused]
tests = ['snapused_001_pos', 'snapused_002_pos', 'snapused_003_pos',
'snapused_004_pos', 'snapused_005_pos']
+1 -1
View File
@@ -172,7 +172,7 @@ crtfile(char *pname)
exit(errno);
}
if (fsetxattr(fd, "xattr", pbuf, 1024, 0) < 0) {
if (fsetxattr(fd, "user.xattr", pbuf, 1024, 0) < 0) {
(void) fprintf(stderr, "fsetxattr(fd, \"xattr\", pbuf, "
"1024, 0) failed.\n[%d]: %s.\n", errno, strerror(errno));
exit(errno);
+2 -1
View File
@@ -85,6 +85,7 @@ export SHARE="@SHARE@"
export SHUF="@SHUF@"
export SLEEP="@SLEEP@"
export SORT="@SORT@"
export STAT="@STAT@"
export STRINGS="@STRINGS@"
export SU="@SU@"
export SUM="@SUM@"
@@ -97,8 +98,8 @@ export TAIL="@TAIL@"
export TAR="@TAR@"
export TOUCH="@TOUCH@"
export TR="@TR@"
export TRUE="@TRUE@"
export TRUNCATE="@TRUNCATE@"
export TRUE="@TRUE@"
export UDEVADM="@UDEVADM@"
export UFSDUMP="@UFSDUMP@"
export UFSRESTORE="@UFSRESTORE@"
@@ -10,4 +10,7 @@ dist_pkgdata_SCRIPTS = \
zfs_receive_006_pos.ksh \
zfs_receive_007_neg.ksh \
zfs_receive_008_pos.ksh \
zfs_receive_009_neg.ksh
zfs_receive_009_neg.ksh \
zfs_receive_010_pos.ksh \
zfs_receive_011_pos.ksh \
zfs_receive_012_pos.ksh
@@ -61,7 +61,7 @@ test_pool ()
first_object=$(ls -i $mntpnt | awk '{print $1}')
log_must $ZFS snapshot $POOL/fs@a
while true; do
log_must $FIND $mntpnt -delete
log_must $FIND $mntpnt/* -delete
sync
log_must $MKFILES "$mntpnt/" 4000
FILE=$(ls -i $mntpnt | awk \
@@ -74,9 +74,11 @@ function setup_test_model
if is_global_zone ; then
log_must $ZFS create -V 16M $pool/vol
log_must $ZFS create -V 16M $pool/$FS/vol
block_device_wait
log_must $ZFS snapshot $pool/$FS/vol@vsnap
log_must $ZFS clone $pool/$FS/vol@vsnap $pool/$FS/vclone
block_device_wait
fi
log_must snapshot_tree $pool/$FS/fs1/fs2@fsnap
@@ -199,10 +201,10 @@ function cmp_ds_prop
typeset dtst1=$1
typeset dtst2=$2
for item in "type" "origin" "volblocksize" "aclinherit" "aclmode" \
for item in "type" "origin" "volblocksize" "aclinherit" "acltype" \
"atime" "canmount" "checksum" "compression" "copies" "devices" \
"dnodesize" "exec" "quota" "readonly" "recordsize" "reservation" \
"setuid" "sharenfs" "snapdir" "version" "volsize" "xattr" "zoned" \
"setuid" "snapdir" "version" "volsize" "xattr" "zoned" \
"mountpoint";
do
$ZFS get -H -o property,value,source $item $dtst1 >> \
@@ -393,7 +395,7 @@ function mk_files
for ((i=0; i<$nfiles; i=i+1)); do
$DD if=/dev/urandom \
of=/$fs/file-$maxsize-$((i+$file_id_offset)) \
bs=$(($RANDOM * $RANDOM % $maxsize)) \
bs=$((($RANDOM * $RANDOM % ($maxsize - 1)) + 1)) \
count=1 >/dev/null 2>&1 || log_fail \
"Failed to create /$fs/file-$maxsize-$((i+$file_id_offset))"
done
@@ -438,7 +440,7 @@ function mess_file
# write the same value that's already there.
#
log_must eval "$DD if=/dev/urandom of=$file conv=notrunc " \
"bs=1 count=2 oseek=$offset >/dev/null 2>&1"
"bs=1 count=2 seek=$offset >/dev/null 2>&1"
else
log_must $TRUNCATE -s $offset $file
fi
@@ -523,20 +525,20 @@ function test_fs_setup
mk_files 100 1048576 0 $sendfs &
mk_files 10 10485760 0 $sendfs &
mk_files 1 104857600 0 $sendfs &
log_must $WAIT
wait
log_must $ZFS snapshot $sendfs@a
rm_files 200 256 0 $sendfs &
rm_files 200 131072 0 $sendfs &
rm_files 20 1048576 0 $sendfs &
rm_files 2 10485760 0 $sendfs &
log_must $WAIT
wait
mk_files 400 256 0 $sendfs &
mk_files 400 131072 0 $sendfs &
mk_files 40 1048576 0 $sendfs &
mk_files 4 10485760 0 $sendfs &
log_must $WAIT
wait
log_must $ZFS snapshot $sendfs@b
log_must eval "$ZFS send -v $sendfs@a >/$sendpool/initial.zsend"
@@ -110,9 +110,6 @@ function cleanup
log_must $ZFS inherit $prop $POOL2
done
#if is_shared $POOL; then
# log_must $ZFS set sharenfs=off $POOL
#fi
log_must setup_test_model $POOL
if [[ -d $TESTDIR ]]; then
@@ -131,7 +128,7 @@ for fs in "$POOL" "$POOL/pclone" "$POOL/$FS" "$POOL/$FS/fs1" \
"$POOL/$FS/fs1/fs2" "$POOL/$FS/fs1/fclone" ; do
rand_set_prop $fs aclinherit "discard" "noallow" "secure" "passthrough"
rand_set_prop $fs checksum "on" "off" "fletcher2" "fletcher4" "sha256"
rand_set_prop $fs aclmode "discard" "groupmask" "passthrough"
rand_set_prop $fs acltype "off" "noacl" "posixacl"
rand_set_prop $fs atime "on" "off"
rand_set_prop $fs checksum "on" "off" "fletcher2" "fletcher4" "sha256"
rand_set_prop $fs compression "on" "off" "lzjb" "gzip" \
@@ -161,7 +158,8 @@ done
# Verify inherited property can be received
rand_set_prop $POOL sharenfs "on" "off" "rw"
rand_set_prop $POOL redundant_metadata "all" "most"
rand_set_prop $POOL sync "standard" "always" "disabled"
#
# Duplicate POOL2 for testing
+1
View File
@@ -46,6 +46,7 @@ log_must cleanup_pool $POOL2
log_must eval "$ZFS send -R $POOL/$FS@final > $BACKDIR/fs-final-R"
log_must eval "$ZFS receive -d $POOL2 < $BACKDIR/fs-final-R"
block_device_wait
log_must eval "$ZPOOL export $POOL"
log_must eval "$ZPOOL import $POOL"
View File
View File
View File
View File
View File