From: Nathaniel Clark Date: Mon, 8 Aug 2016 20:35:00 +0000 (-0400) Subject: LU-5473 tests: sanity/51b Account for ZFS inode size X-Git-Tag: 2.8.59~50 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=15dd813536ad06a119dfb2358f00281eed22a98b LU-5473 tests: sanity/51b Account for ZFS inode size Account for inode size for 11KB for ZFS (and 4KB for LDISKFS) when checking space on MDC during sanity test_51b. Do lfs df and lfs df -i on completion of sanity/test_51b. This helps determine the correct inode size accounting. Test-Parameters: trivial mdsfilesystemtype=zfs mdtfilesystemtype=zfs ostfilesystemtype=zfs testlist=sanity envdefinitions=SLOW=yes mdscount=1 Signed-off-by: Nathaniel Clark Change-Id: Icd8e0d55a89d8e3d22bbb1b2ff206e238a7262ac Reviewed-on: http://review.whamcloud.com/21821 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: James Nunez Reviewed-by: Jian Yu Reviewed-by: Oleg Drokin --- diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index 0c617fe..5a26c77 100755 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -81,8 +81,8 @@ init_logging if [ $(facet_fstype $SINGLEMDS) = "zfs" ]; then # bug number for skipped test: LU-4536 LU-1957 ALWAYS_EXCEPT="$ALWAYS_EXCEPT 65ic 180" - # 4 13 (min)" - [ "$SLOW" = "no" ] && EXCEPT_SLOW="$EXCEPT_SLOW 51b 51ba" + # 13 (min)" + [ "$SLOW" = "no" ] && EXCEPT_SLOW="$EXCEPT_SLOW 51b" fi FAIL_ON_ERROR=false @@ -4097,6 +4097,12 @@ test_51a() { # was test_51 } run_test 51a "special situations: split htree with empty entry ==" +cleanup_print_lfs_df () { + trap 0 + $LFS df + $LFS df -i +} + test_51b() { [ $PARALLEL == "yes" ] && skip "skip parallel run" && return local dir=$DIR/$tdir @@ -4118,10 +4124,12 @@ test_51b() { # need to check free space for the directories as well local blkfree=$(lctl get_param -n mdc.$FSNAME-MDT$mdtidx*.kbytesavail) - numfree=$((blkfree / 4)) + numfree=$(( blkfree / $(fs_inode_ksize) )) [[ $numfree -lt $nrdirs ]] && skip "not enough blocks ($numfree)" && return + trap cleanup_print_lfsdf EXIT + # create files createmany -d $dir/d $nrdirs || error "failed to create $nrdirs subdirs in MDT$mdtidx:$dir" @@ -4133,6 +4141,9 @@ test_51b() { local left=100 local delete=$((nrdirs - left)) + $LFS df + $LFS df -i + # for ldiskfs the nlink count should be 1, but this is OSD specific # and so this is listed for informational purposes only echo "nlink before: $(stat -c %h $dir), created before: $nrdirs" @@ -4151,6 +4162,8 @@ test_51b() { local after=$(stat -c %h $dir) [[ $after -gt 2 ]] && error "nlink after: $after > 2" || echo "nlink after: $after" + + cleanup_print_lfs_df } run_test 51b "exceed 64k subdirectory nlink limit on create, verify unlink" diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh index 8561897..95ddf56 100755 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -700,6 +700,18 @@ fs_log_size() { echo -n $size } +fs_inode_ksize() { + local facet=${1:-$SINGLEMDS} + local fstype=$(facet_fstype $facet) + local size=0 + case $fstype in + ldiskfs) size=4;; # ~4KB per inode + zfs) size=11;; # 10 to 11KB per inode + esac + + echo -n $size +} + check_gss_daemon_nodes() { local list=$1 dname=$2