From: Bobi Jam Date: Thu, 9 Jun 2011 08:50:04 +0000 (+0800) Subject: LU-404 bind umount /sbin/mount.lustre only if necessary X-Git-Tag: 2.0.63.0~6 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=e89a156141ba14fe306e7eacc73a2738984c1c5b;hp=60e6514a8280f90a97c00e18a3774b5e0212f7ff LU-404 bind umount /sbin/mount.lustre only if necessary On lustre release installed system, /sbin/mount.lustre will not bind mount upon $LUSTRE/utils/mount.lustre, so don't need bind umount it. Signed-off-by: Bobi Jam Change-Id: I49e671f0acf991a54a01c4f2bb1e82c2db93aa3e Reviewed-on: http://review.whamcloud.com/918 Reviewed-by: Brian J. Murrell Tested-by: Hudson Reviewed-by: Andreas Dilger --- diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh index ecf4ef8..14547a1 100644 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -372,9 +372,10 @@ load_modules_local() { $LCTL modules > $OGDB/ogdb-$HOSTNAME # 'mount' doesn't look in $PATH, just sbin - local bindmount=$(mount | grep "/sbin/mount.lustre") - if [ -f $LUSTRE/utils/mount.lustre ] && [ "x$bindmount" == "x" ]; then - mount --bind $LUSTRE/utils/mount.lustre /sbin/mount.lustre || true + if [ -f $LUSTRE/utils/mount.lustre ] && \ + ! grep -qe "/sbin/mount\.lustre " /proc/mounts; then + [ ! -f /sbin/mount.lustre ] && touch /sbin/mount.lustre + mount --bind $LUSTRE/utils/mount.lustre /sbin/mount.lustre || true fi } @@ -417,7 +418,11 @@ unload_modules() { fi fi - umount /sbin/mount.lustre + if grep -qe "/sbin/mount\.lustre" /proc/mounts; then + umount /sbin/mount.lustre || true + [ -w /sbin/mount.lustre -a ! -s /sbin/mount.lustre ] && \ + rm -f /sbin/mount.lustre || true + fi check_mem_leak || return 254