From fed7a99441c2dd078a671cf5b3dcaf27996bf448 Mon Sep 17 00:00:00 2001 From: Andreas Dilger Date: Tue, 27 May 2014 20:13:18 +0800 Subject: [PATCH] LU-4573 tests: check all MDTs for open files sanityn.sh test_76 verifying mdt.*.exports.*.open_files content did not check all of the MDTs. It was broken by commit 370de927fc5, which created all directories striped across all MDTs by default. There is actually no need to special-case striped or remote directories in this test, and it should be possible to just check for open files on all MDTs, and this also simplifies the test. Signed-off-by: Andreas Dilger Signed-off-by: Jian Yu Change-Id: I2b7b434052946c8d84bffef1fc7358cc29b00b75 Reviewed-on: http://review.whamcloud.com/10107 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: wangdi --- lustre/tests/sanityn.sh | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/lustre/tests/sanityn.sh b/lustre/tests/sanityn.sh index a3bf7ca..4b46cc4 100644 --- a/lustre/tests/sanityn.sh +++ b/lustre/tests/sanityn.sh @@ -2695,14 +2695,9 @@ run_test 75 "osc: upcall after unuse lock===================" test_76() { #LU-946 [[ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.5.53) ]] && skip "Need MDS version at least 2.5.53" && return - [ $MDSCOUNT -ge 2 ] && skip "skip now for LU-4573" && return #LU-4573 remote_mds_nodsh && skip "remote MDS with nodsh" && return local fcount=2048 - local fd - local cmd - local mdt_idx - local mds_idx declare -a fd_list declare -a fid_list @@ -2714,29 +2709,24 @@ test_76() { #LU-946 rm -rf $DIR/$tdir test_mkdir -p $DIR/$tdir - if [ $MDSCOUNT -gt 1 ]; then - mdt_idx=$($LFS getdirstripe -i $DIR/$tdir) - else - mdt_idx=0 - fi - mds_idx=$((mdt_idx + 1)) - proc_ofile="mdt.*$mdt_idx.exports.'$nid'.open_files" + # drop all open locks and close any cached "open" files on the client cancel_lru_locks mdc echo -n "open files " ulimit -n 8096 - for (( i = 0; i < $fcount; i++ )) ; do + for ((i = 0; i < $fcount; i++)); do touch $DIR/$tdir/f_$i - fd=$(free_fd) - cmd="exec $fd<$DIR/$tdir/f_$i" + local fd=$(free_fd) + local cmd="exec $fd<$DIR/$tdir/f_$i" eval $cmd fd_list[i]=$fd echo -n "." done echo - fid_list=($(do_facet mds$mds_idx $LCTL get_param -n $proc_ofile)) + local get_open_fids="$LCTL get_param -n mdt.*.exports.'$nid'.open_files" + local fid_list=($(do_nodes $(comma_list $(mdts_nodes)) $get_open_fids)) # Possible errors in openfiles FID list. # 1. Missing FIDs. Check 1 -- 1.8.3.1