From 80b00a3a715b33d56e71b88dce11283aa53bf1eb Mon Sep 17 00:00:00 2001 From: wang di Date: Wed, 7 May 2014 03:24:33 -0700 Subject: [PATCH 1/1] LU-4206 tests: cancel data lock before ELC test 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 Change-Id: Ib216d068e71dce8236f26cb62188fff6d090042a Reviewed-on: http://review.whamcloud.com/10250 Reviewed-by: John L. Hammond Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Jinshan Xiong Reviewed-by: Oleg Drokin --- lustre/tests/sanity.sh | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index 95f5fce..849b125 100644 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -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}') -- 1.8.3.1