From: wang di Date: Fri, 15 Nov 2013 08:00:05 +0000 (-0800) Subject: LU-4223 tests: delete loop device when umount X-Git-Tag: 2.5.52~64 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=ef0f617b354d8e41c07efa74c9fe051012ed773f LU-4223 tests: delete loop device when umount Delete loop device with umount -d, to avoid loop device leaking. Signed-off-by: wang di Change-Id: I55bafefa1d387116333aafc71b599ef888c57a2b Reviewed-on: http://review.whamcloud.com/8296 Tested-by: Jenkins Reviewed-by: Andreas Dilger Tested-by: Maloo Reviewed-by: Bob Glossman Reviewed-by: Jian Yu --- diff --git a/lustre/tests/conf-sanity.sh b/lustre/tests/conf-sanity.sh index 4784af75..32ee910 100644 --- a/lustre/tests/conf-sanity.sh +++ b/lustre/tests/conf-sanity.sh @@ -1558,7 +1558,7 @@ t32_test() { $r mount -t lustre -o loop,nosvc $tmp/mdt $tmp/mnt/mdt $r lctl replace_nids $fsname-OST0000 $ostnid $r lctl replace_nids $fsname-MDT0000 $nid - $r umount $tmp/mnt/mdt + $r umount -d $tmp/mnt/mdt fi mopts=loop,exclude=$fsname-OST0000 @@ -3449,7 +3449,7 @@ test_58() { # bug 22658 # remove all files from the OBJECTS dir do_facet $SINGLEMDS "mount -t ldiskfs $opts $devname $MNTDIR" do_facet $SINGLEMDS "find $MNTDIR/O/1/d* -type f -delete" - do_facet $SINGLEMDS "umount $MNTDIR" + do_facet $SINGLEMDS "umount -d $MNTDIR" # restart MDS with missing llog files start_mds do_facet mds "lctl set_param fail_loc=0" @@ -3675,7 +3675,7 @@ test_65() { # LU-2237 do_facet $SINGLEMDS \ "mount -t $(facet_fstype $SINGLEMDS) $opts $devname $brpt" do_facet $SINGLEMDS "rm -f ${brpt}/last_rcvd" - do_facet $SINGLEMDS "umount $brpt" + do_facet $SINGLEMDS "umount -d $brpt" # restart MDS, the "last_rcvd" file should be recreated. start_mds || error "fail to restart the MDS" diff --git a/lustre/tests/sanity-quota.sh b/lustre/tests/sanity-quota.sh index e43d27f..4b55d22 100644 --- a/lustre/tests/sanity-quota.sh +++ b/lustre/tests/sanity-quota.sh @@ -2281,7 +2281,7 @@ test_36() { do_node $mdt0_node mkdir $mntpt/OBJECTS do_node $mdt0_node cp $LUSTRE/tests/admin_quotafile_v2.usr $mntpt/OBJECTS do_node $mdt0_node cp $LUSTRE/tests/admin_quotafile_v2.grp $mntpt/OBJECTS - do_node $mdt0_node umount -f $mntpt + do_node $mdt0_node umount -d -f $mntpt echo "Setup all..." setupall diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index 62fec65..00da642 100644 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -2160,7 +2160,7 @@ run_test 31o "duplicate hard links with same filename" cleanup_test32_mount() { trap 0 - $UMOUNT $DIR/$tdir/ext2-mountpoint + $UMOUNT -d $DIR/$tdir/ext2-mountpoint } test_32a() { @@ -2368,7 +2368,7 @@ run_test 32p "open d32p/symlink->tmp/symlink->lustre-root/$tfile" cleanup_testdir_mount() { trap 0 - $UMOUNT $DIR/$tdir + $UMOUNT -d $DIR/$tdir } test_32q() { @@ -3984,7 +3984,7 @@ test_54c() { dd if=/dev/zero of=$tdir/tmp bs=`page_size` count=30 || error "dd write" df $tdir dd if=$tdir/tmp of=/dev/zero bs=`page_size` count=30 || error "dd read" - $UMOUNT $tdir + $UMOUNT -d $tdir losetup -d $loopdev rm $loopdev }