5 # The contents of this file are subject to the terms of the
6 # Common Development and Distribution License (the "License").
7 # You may not use this file except in compliance with the License.
9 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 # or http://www.opensolaris.org/os/licensing.
11 # See the License for the specific language governing permissions
12 # and limitations under the License.
14 # When distributing Covered Code, include this CDDL HEADER in each
15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 # If applicable, add the following below this CDDL HEADER, with the
17 # fields enclosed by brackets "[]" replaced with your own identifying
18 # information: Portions Copyright [yyyy] [name of copyright owner]
24 # Copyright (c) 2017 by Lawrence Livermore National Security, LLC.
25 # Use is subject to license terms.
28 . $STF_SUITE/include/libtest.shlib
32 # Run many xattrtests on a dataset with large dnodes and xattr=sa to
33 # stress concurrent allocation of large dnodes.
36 TEST_FS=$TESTPOOL/large_dnode
38 verify_runnable "both"
42 datasetexists $TEST_FS && log_must zfs destroy $TEST_FS
46 log_assert "xattrtest runs concurrently on dataset with large dnodes"
48 log_must zfs create $TEST_FS
49 log_must zfs set dnsize=auto $TEST_FS
50 log_must zfs set xattr=sa $TEST_FS
52 for ((i=0; i < 100; i++)); do
53 dir="/$TEST_FS/dir.$i"
57 if [ $((RANDOM % 2)) -eq 0 ]; then
58 do_unlink="-k -f 1024"
60 do_unlink="-f $((RANDOM % 1024))"
62 log_must eval "xattrtest -R -r -y -x 1 $do_unlink -p $dir >/dev/null 2>&1 &"
67 log_must zpool export $TESTPOOL
68 log_must zpool import $TESTPOOL
69 log_must ls -lR "/$TEST_FS/" >/dev/null 2>&1
70 log_must zdb -d $TESTPOOL