-
Notifications
You must be signed in to change notification settings - Fork 766
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reviewed by: Jerry Jelinek <[email protected]> Reviewed by: Toomas Soome <[email protected]> Reviewed by: Andy Fiddaman <[email protected]> Reviewed by: Kody Kantor <[email protected]> Approved by: Dan McDonald <[email protected]>
- Loading branch information
Showing
22 changed files
with
774 additions
and
3 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -70,4 +70,5 @@ typeset -a properties=( | |
"feature@skein" | ||
"feature@edonr" | ||
"feature@device_removal" | ||
"feature@large_dnode" | ||
) |
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
21 changes: 21 additions & 0 deletions
21
usr/src/test/zfs-tests/tests/functional/large_dnode/Makefile
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,21 @@ | ||
# | ||
# 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. | ||
# | ||
|
||
# | ||
# Copyright (c) 2013, 2016 by Delphix. All rights reserved. | ||
# | ||
|
||
include $(SRC)/Makefile.master | ||
|
||
ROOTOPTPKG = $(ROOT)/opt/zfs-tests | ||
TARGETDIR = $(ROOTOPTPKG)/tests/functional/large_dnode | ||
|
||
include $(SRC)/test/zfs-tests/Makefile.com |
25 changes: 25 additions & 0 deletions
25
usr/src/test/zfs-tests/tests/functional/large_dnode/cleanup.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,25 @@ | ||
#!/bin/ksh -p | ||
# | ||
# CDDL HEADER START | ||
# | ||
# The contents of this file are subject to the terms of the | ||
# Common Development and Distribution License (the "License"). | ||
# You may not use this file except in compliance with the License. | ||
# | ||
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE | ||
# or http://www.opensolaris.org/os/licensing. | ||
# See the License for the specific language governing permissions | ||
# and limitations under the License. | ||
# | ||
# When distributing Covered Code, include this CDDL HEADER in each | ||
# file and include the License file at usr/src/OPENSOLARIS.LICENSE. | ||
# If applicable, add the following below this CDDL HEADER, with the | ||
# fields enclosed by brackets "[]" replaced with your own identifying | ||
# information: Portions Copyright [yyyy] [name of copyright owner] | ||
# | ||
# CDDL HEADER END | ||
# | ||
|
||
. $STF_SUITE/include/libtest.shlib | ||
|
||
default_cleanup |
77 changes: 77 additions & 0 deletions
77
usr/src/test/zfs-tests/tests/functional/large_dnode/large_dnode_001_pos.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 | ||
# | ||
# The contents of this file are subject to the terms of the | ||
# Common Development and Distribution License (the "License"). | ||
# You may not use this file except in compliance with the License. | ||
# | ||
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE | ||
# or http://www.opensolaris.org/os/licensing. | ||
# See the License for the specific language governing permissions | ||
# and limitations under the License. | ||
# | ||
# When distributing Covered Code, include this CDDL HEADER in each | ||
# file and include the License file at usr/src/OPENSOLARIS.LICENSE. | ||
# If applicable, add the following below this CDDL HEADER, with the | ||
# fields enclosed by brackets "[]" replaced with your own identifying | ||
# information: Portions Copyright [yyyy] [name of copyright owner] | ||
# | ||
# CDDL HEADER END | ||
# | ||
|
||
. $STF_SUITE/include/libtest.shlib | ||
|
||
# | ||
# DESCRIPTION: | ||
# Verify that the dnode sizes of newly created files are consistent | ||
# with the dnodesize dataset property. | ||
# | ||
# STRATEGY: | ||
# 1. Create a file system | ||
# 2. Set dnodesize to a legal literal value | ||
# 3. Create a file | ||
# 4. Repeat 2-3 for all legal literal values of dnodesize values | ||
# 5. Unmount the file system | ||
# 6. Use zdb to check expected dnode sizes | ||
# | ||
|
||
TEST_FS=$TESTPOOL/large_dnode | ||
|
||
verify_runnable "both" | ||
|
||
function cleanup | ||
{ | ||
datasetexists $TEST_FS && log_must zfs destroy $TEST_FS | ||
} | ||
|
||
log_onexit cleanup | ||
log_assert "dnode sizes are consistent with dnodesize dataset property" | ||
|
||
log_must zfs create $TEST_FS | ||
|
||
set -A dnsizes "512" "1k" "2k" "4k" "8k" "16k" | ||
set -A inodes | ||
|
||
for ((i=0; i < ${#dnsizes[*]}; i++)) ; do | ||
size=${dnsizes[$i]} | ||
if [[ $size == "512" ]] ; then | ||
size="legacy" | ||
fi | ||
file=/$TEST_FS/file.$size | ||
log_must zfs set dnsize=$size $TEST_FS | ||
touch $file | ||
inodes[$i]=$(ls -li $file | awk '{print $1}') | ||
done | ||
|
||
log_must zfs umount $TEST_FS | ||
|
||
for ((i=0; i < ${#dnsizes[*]}; i++)) ; do | ||
dnsize=$(zdb -dddd $TEST_FS ${inodes[$i]} | | ||
awk '/ZFS plain file/ {print $6}' | tr K k) | ||
if [[ "$dnsize" != "${dnsizes[$i]}" ]]; then | ||
log_fail "dnode size is $dnsize (expected ${dnsizes[$i]})" | ||
fi | ||
done | ||
|
||
log_pass "dnode sizes are consistent with dnodesize dataset property" |
78 changes: 78 additions & 0 deletions
78
usr/src/test/zfs-tests/tests/functional/large_dnode/large_dnode_002_pos.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,78 @@ | ||
#!/bin/ksh -p | ||
# | ||
# CDDL HEADER START | ||
# | ||
# The contents of this file are subject to the terms of the | ||
# Common Development and Distribution License (the "License"). | ||
# You may not use this file except in compliance with the License. | ||
# | ||
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE | ||
# or http://www.opensolaris.org/os/licensing. | ||
# See the License for the specific language governing permissions | ||
# and limitations under the License. | ||
# | ||
# When distributing Covered Code, include this CDDL HEADER in each | ||
# file and include the License file at usr/src/OPENSOLARIS.LICENSE. | ||
# If applicable, add the following below this CDDL HEADER, with the | ||
# fields enclosed by brackets "[]" replaced with your own identifying | ||
# information: Portions Copyright [yyyy] [name of copyright owner] | ||
# | ||
# CDDL HEADER END | ||
# | ||
|
||
. $STF_SUITE/include/libtest.shlib | ||
|
||
# | ||
# DESCRIPTION: | ||
# Verify that extended attributes can use extra bonus space of a large | ||
# dnode without kicking in a spill block. | ||
# | ||
# STRATEGY: | ||
# 1. Create a file system with xattr=sa | ||
# 2. Set dnodesize to a legal literal value | ||
# 3. Create a file | ||
# 4 Store an xattr that fits within the dnode size | ||
# 4. Repeat 2-3 for all legal literal values of dnodesize values | ||
# 5. Unmount the file system | ||
# 6. Use zdb to check for missing SPILL_BLKPTR flag | ||
# | ||
|
||
TEST_FS=$TESTPOOL/large_dnode | ||
|
||
verify_runnable "both" | ||
|
||
function cleanup | ||
{ | ||
datasetexists $TEST_FS && log_must zfs destroy $TEST_FS | ||
} | ||
|
||
log_onexit cleanup | ||
log_assert "extended attributes use extra bonus space of a large dnode" | ||
|
||
log_must zfs create -o xattr=sa $TEST_FS | ||
|
||
# Store dnode size minus 512 in an xattr | ||
set -A xattr_sizes "512" "1536" "3584" "7680" "15872" | ||
set -A prop_values "1k" "2k" "4k" "8k" "16k" | ||
set -A inodes | ||
|
||
for ((i=0; i < ${#prop_values[*]}; i++)) ; do | ||
prop_val=${prop_values[$i]} | ||
file=/$TEST_FS/file.$prop_val | ||
log_must zfs set dnsize=$prop_val $TEST_FS | ||
touch $file | ||
xattr_size=${xattr_sizes[$i]} | ||
xattr_name=user.foo | ||
xattr_val=$(dd if=/dev/urandom bs=1 count=$xattr_size | | ||
openssl enc -a -A) | ||
log_must setfattr -n $xattr_name -v 0s$xattr_val $file | ||
inodes[$i]=$(ls -li $file | awk '{print $1}') | ||
done | ||
|
||
log_must zfs umount $TEST_FS | ||
|
||
for ((i=0; i < ${#inodes[*]}; i++)) ; do | ||
log_mustnot eval "zdb -dddd $TEST_FS ${inodes[$i]} | grep SPILL_BLKPTR" | ||
done | ||
|
||
log_pass "extended attributes use extra bonus space of a large dnode" |
65 changes: 65 additions & 0 deletions
65
usr/src/test/zfs-tests/tests/functional/large_dnode/large_dnode_003_pos.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,65 @@ | ||
#!/bin/ksh -p | ||
# | ||
# CDDL HEADER START | ||
# | ||
# The contents of this file are subject to the terms of the | ||
# Common Development and Distribution License (the "License"). | ||
# You may not use this file except in compliance with the License. | ||
# | ||
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE | ||
# or http://www.opensolaris.org/os/licensing. | ||
# See the License for the specific language governing permissions | ||
# and limitations under the License. | ||
# | ||
# When distributing Covered Code, include this CDDL HEADER in each | ||
# file and include the License file at usr/src/OPENSOLARIS.LICENSE. | ||
# If applicable, add the following below this CDDL HEADER, with the | ||
# fields enclosed by brackets "[]" replaced with your own identifying | ||
# information: Portions Copyright [yyyy] [name of copyright owner] | ||
# | ||
# CDDL HEADER END | ||
# | ||
|
||
. $STF_SUITE/include/libtest.shlib | ||
|
||
verify_runnable "both" | ||
|
||
function cleanup | ||
{ | ||
if datasetexists $LDNPOOL ; then | ||
log_must zpool destroy -f $LDNPOOL | ||
fi | ||
} | ||
|
||
log_onexit cleanup | ||
|
||
log_assert "feature correctly switches between enabled and active" | ||
|
||
LDNPOOL=ldnpool | ||
LDNFS=$LDNPOOL/large_dnode | ||
log_must mkfile 64M $TESTDIR/$LDNPOOL | ||
log_must zpool create $LDNPOOL $TESTDIR/$LDNPOOL | ||
|
||
|
||
state=$(zpool list -Ho feature@large_dnode $LDNPOOL) | ||
if [[ "$state" != "enabled" ]]; then | ||
log_fail "large_dnode has state $state (expected enabled)" | ||
fi | ||
|
||
log_must zfs create -o dnodesize=1k $LDNFS | ||
log_must touch /$LDNFS/foo | ||
log_must zfs unmount $LDNFS | ||
|
||
state=$(zpool list -Ho feature@large_dnode $LDNPOOL) | ||
if [[ "$state" != "active" ]]; then | ||
log_fail "large_dnode has state $state (expected active)" | ||
fi | ||
|
||
log_must zfs destroy $LDNFS | ||
|
||
state=$(zpool list -Ho feature@large_dnode $LDNPOOL) | ||
if [[ "$state" != "enabled" ]]; then | ||
log_fail "large_dnode has state $state (expected enabled)" | ||
fi | ||
|
||
log_pass |
Oops, something went wrong.