Whamcloud - gitweb
LU-3909 tests: sanity test 129 fix 43/8143/4
authorVladimir Saveliev <vladimir_saveliev@xyratex.com>
Fri, 22 Nov 2013 13:46:08 +0000 (17:46 +0400)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 11 Dec 2013 14:01:49 +0000 (14:01 +0000)
Patch from LU-2479 changed max dir size limit behaviour. Before the
patch last block of a directory which reached its limit was mostly
empty so that creation of new file after limit cancelation caused no
dir size grow. With the patch last block of limited directory gets
full when limit is reached. Therefore dir size increases on file
creation after limit cancellation.
The patch makes sanity test_129 to distinguish these cases.

Xyratex-bug-id: MRP-1444
Signed-off-by: Vladmir Saveliev <vladimir_saveliev@xyratex.com>
Change-Id: I0ea9eee5a0d20f31d9f62e9e5f2af1ee550f3588
Reviewed-on: http://review.whamcloud.com/8143
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Jian Yu <jian.yu@intel.com>
lustre/tests/sanity.sh

index 2831fde..ff16f9b 100644 (file)
@@ -7964,11 +7964,15 @@ test_129() {
        ENOSPC=28
        EFBIG=27
 
+       rm -rf $DIR/$tdir
        test_mkdir -p $DIR/$tdir
 
-       MAX=$(stat -c%s "$DIR/$tdir")
+       # block size of mds1
+       local MDT_DEV=$(mdsdevname ${SINGLEMDS//mds/})
+       local MDSBLOCKSIZE=$($LCTL get_param -n mdc.*MDT0000*.blocksize)
+       local MAX=$((MDSBLOCKSIZE * 3))
        set_dir_limits $MAX
-       local I=0
+       local I=$(stat -c%s "$DIR/$tdir")
        local J=0
        while [ ! $I -gt $MAX ]; do
                $MULTIOP $DIR/$tdir/$J Oc
@@ -7976,18 +7980,22 @@ test_129() {
                #check two errors ENOSPC for new version of ext4 max_dir_size patch
                #mainline kernel commit df981d03eeff7971ac7e6ff37000bfa702327ef1
                #and EFBIG for previous versions
-               if [ $rc -eq $EFBIG -o $rc -eq $ENOSPC ] && [ $I -gt 0 ]; then
+               if [ $rc -eq $EFBIG -o $rc -eq $ENOSPC ]; then
                        set_dir_limits 0
                        echo "return code $rc received as expected"
-                       multiop $DIR/$tdir/$J Oc
-                       rc=$?
+                       multiop $DIR/$tdir/$J Oc ||
+                               error_exit "multiop failed w/o dir size limit"
+
                        I=$(stat -c%s "$DIR/$tdir")
-                       if [ $I -gt $MAX ] && [ $rc -eq 0 ]; then
-                               return 0
+
+                       if [ $(lustre_version_code $SINGLEMDS) -lt \
+                                       $(version_code 2.4.51) ]
+                       then
+                               [ $I -eq $MAX ] && return 0
                        else
-                               error_exit "return code $rc current dir size $I " \
-                                          "previous limit $MAX"
+                               [ $I -gt $MAX ] && return 0
                        fi
+                       error_exit "current dir size $I, previous limit $MAX"
                elif [ $rc -ne 0 ]; then
                        set_dir_limits 0
                        error_exit "return code $rc received instead of expected " \