Whamcloud - gitweb
LU-4206 tests: cancel data lock before ELC test 50/10250/4
authorwang di <di.wang@intel.com>
Wed, 7 May 2014 10:24:33 +0000 (03:24 -0700)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 8 May 2014 17:22:13 +0000 (17:22 +0000)
Since 2,4, MDT will send unlink request to the OST, and OST
will destroy the object and revoke the data lock in the client
cache, i.e. client will not do ELC for data lock during the
rename and unlink. So cancel the data lock before couting
lock block callback counting.

Signed-off-by: wang di <di.wang@intel.com>
Change-Id: Ib216d068e71dce8236f26cb62188fff6d090042a
Reviewed-on: http://review.whamcloud.com/10250
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/tests/sanity.sh

index 95f5fce..849b125 100644 (file)
@@ -7683,12 +7683,16 @@ test_120e() {
         cancel_lru_locks osc
         dd if=$DIR/$tdir/f1 of=/dev/null
         stat $DIR/$tdir $DIR/$tdir/f1 > /dev/null
+       # XXX client can not do early lock cancel of OST lock
+       # during unlink (LU-4206), so cancel osc lock now.
+       cancel_lru_locks osc
        can1=$(do_facet $SINGLEMDS \
               "$LCTL get_param -n ldlm.services.ldlm_canceld.stats" |
               awk '/ldlm_cancel/ {print $2}')
        blk1=$($LCTL get_param -n ldlm.services.ldlm_cbd.stats |
               awk '/ldlm_bl_callback/ {print $2}')
        unlink $DIR/$tdir/f1
+       sleep 5
        can2=$(do_facet $SINGLEMDS \
               "$LCTL get_param -n ldlm.services.ldlm_canceld.stats" |
               awk '/ldlm_cancel/ {print $2}')
@@ -7710,19 +7714,23 @@ test_120f() {
         lru_resize_disable osc
        test_mkdir -p -c1 $DIR/$tdir/d1
        test_mkdir -p -c1 $DIR/$tdir/d2
-        dd if=/dev/zero of=$DIR/$tdir/d1/f1 count=1
-        dd if=/dev/zero of=$DIR/$tdir/d2/f2 count=1
-        cancel_lru_locks mdc
-        cancel_lru_locks osc
-        dd if=$DIR/$tdir/d1/f1 of=/dev/null
-        dd if=$DIR/$tdir/d2/f2 of=/dev/null
-        stat $DIR/$tdir/d1 $DIR/$tdir/d2 $DIR/$tdir/d1/f1 $DIR/$tdir/d2/f2 > /dev/null
+       dd if=/dev/zero of=$DIR/$tdir/d1/f1 count=1
+       dd if=/dev/zero of=$DIR/$tdir/d2/f2 count=1
+       cancel_lru_locks mdc
+       cancel_lru_locks osc
+       dd if=$DIR/$tdir/d1/f1 of=/dev/null
+       dd if=$DIR/$tdir/d2/f2 of=/dev/null
+       stat $DIR/$tdir/d1 $DIR/$tdir/d2 $DIR/$tdir/d1/f1 $DIR/$tdir/d2/f2 > /dev/null
+       # XXX client can not do early lock cancel of OST lock
+       # during rename (LU-4206), so cancel osc lock now.
+       cancel_lru_locks osc
        can1=$(do_facet $SINGLEMDS \
               "$LCTL get_param -n ldlm.services.ldlm_canceld.stats" |
               awk '/ldlm_cancel/ {print $2}')
        blk1=$($LCTL get_param -n ldlm.services.ldlm_cbd.stats |
               awk '/ldlm_bl_callback/ {print $2}')
-       mv $DIR/$tdir/d1/f1 $DIR/$tdir/d2/f2
+       mrename $DIR/$tdir/d1/f1 $DIR/$tdir/d2/f2
+       sleep 5
        can2=$(do_facet $SINGLEMDS \
               "$LCTL get_param -n ldlm.services.ldlm_canceld.stats" |
               awk '/ldlm_cancel/ {print $2}')