]> git.proxmox.com Git - mirror_zfs.git/blobdiff - tests/zfs-tests/tests/functional/features/large_dnode/large_dnode_008_pos.ksh
Improved dnode allocation and dmu_hold_impl()
[mirror_zfs.git] / tests / zfs-tests / tests / functional / features / large_dnode / large_dnode_008_pos.ksh
index 1f900b5efbe175b609faf43be4c1494e05be3605..eac292cbe064cda91647e8468eae5e8673d6b8a5 100755 (executable)
@@ -42,6 +42,21 @@ function cleanup
        datasetexists $TEST_FS && log_must zfs destroy $TEST_FS
 }
 
+function verify_dnode_packing
+{
+       zdb -dd $TEST_FS | grep -A 3 'Dnode slots' | awk '
+               /Total used:/ {total_used=$NF}
+               /Max used:/ {max_used=$NF}
+               /Percent empty:/ {print total_used, max_used, int($NF)}
+       ' | while read total_used max_used pct_empty
+       do
+               log_note "total_used $total_used max_used $max_used pct_empty $pct_empty"
+               if [ $pct_empty -gt 5 ]; then
+                       log_fail "Holes in dnode array: pct empty $pct_empty > 5"
+               fi
+       done
+}
+
 log_onexit cleanup
 log_assert "xattrtest runs concurrently on dataset with large dnodes"
 
@@ -52,9 +67,11 @@ log_must zfs set xattr=sa $TEST_FS
 for ((i=0; i < 100; i++)); do
        dir="/$TEST_FS/dir.$i"
        log_must mkdir "$dir"
-       log_must eval "xattrtest -R -r -y -x 1 -f 1024 -k -p $dir &"
+       log_must eval "xattrtest -R -r -y -x 1 -f 1024 -k -p $dir >/dev/null 2>&1 &"
 done
 
 log_must wait
 
+verify_dnode_packing
+
 log_pass