1#!/bin/ksh -p 2# 3# CDDL HEADER START 4# 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. 8# 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. 13# 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] 19# 20# CDDL HEADER END 21# 22 23# 24# Copyright (c) 2016 by Lawrence Livermore National Security, LLC. 25# Use is subject to license terms. 26# 27 28# 29# Copyright 2007 Sun Microsystems, Inc. All rights reserved. 30# Use is subject to license terms. 31# 32 33# 34# Copyright (c) 2013, 2016 by Delphix. All rights reserved. 35# 36 37. $STF_SUITE/include/libtest.shlib 38 39# 40# DESCRIPTION: 41# Run xattrtest on a dataset with large dnodes and xattr=sa 42# to stress xattr usage of the extra bonus space and verify 43# contents 44# 45 46TEST_FS=$TESTPOOL/large_dnode 47 48verify_runnable "both" 49 50function cleanup 51{ 52 datasetexists $TEST_FS && log_must zfs destroy $TEST_FS 53} 54 55log_onexit cleanup 56log_assert "xattrtest runs cleanly on dataset with large dnodes" 57 58log_must zfs create $TEST_FS 59 60set -A xattr_sizes "512" "1536" "3584" "7680" "15872" 61set -A prop_values "1k" "2k" "4k" "8k" "16k" 62 63for ((i=0; i < ${#prop_values[*]}; i++)) ; do 64 prop_val=${prop_values[$i]} 65 dir=/$TEST_FS/$prop_val 66 xattr_size=${xattr_sizes[$i]} 67 log_must zfs set dnsize=$prop_val $TEST_FS 68 log_must mkdir $dir 69 log_must xattrtest -R -y -s $xattr_size -f 1024 -p $dir 70done 71 72log_pass 73