From df96fab178534adb34067b20490a2d0629aabe2f Mon Sep 17 00:00:00 2001 From: Nathaniel Clark Date: Fri, 6 Oct 2017 12:49:23 -0400 Subject: [PATCH] LU-10098 scripts: Fix mounted check in Lustre RA The "Lustre" resource agent for pacemaker can mis-identify a resource as being mounted if it's mountpoint is a substring match for anything else in /proc/mounts. Change the lustre_is_mounted() function to check to make sure it's a lustre fs mounted at mountpoint and the "source" (i.e. device) is the target we expect. Signed-off-by: Nathaniel Clark Change-Id: Ib877b0dc3d3ce0d93fd4663aa2418ac21d670428 Reviewed-on: https://review.whamcloud.com/29351 Tested-by: Jenkins Reviewed-by: Malcolm Cowe Tested-by: Maloo Reviewed-by: Olaf Faaland-LLNL Reviewed-by: Oleg Drokin --- contrib/scripts/pacemaker/Lustre | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/contrib/scripts/pacemaker/Lustre b/contrib/scripts/pacemaker/Lustre index e3671b0..645bf96 100755 --- a/contrib/scripts/pacemaker/Lustre +++ b/contrib/scripts/pacemaker/Lustre @@ -95,8 +95,10 @@ END # lustre_is_mounted () { - # Verify if this is consistent - grep -q $(realpath "$OCF_RESKEY_mountpoint") /proc/mounts + # Verify if this is consistent, check pointpoint and filesystem + # against source (i.e. device) + local dev=$(findmnt -t lustre -ln -o SOURCE -T $(realpath "$OCF_RESKEY_mountpoint")) + [ "$dev" == "$OCF_RESKEY_target" ] } lustre_monitor () { -- 1.8.3.1