cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
* [Cluster-devel] [PATCH] Low: Improve netfs unmount when server is unavailable [RHEL6]
@ 2011-08-08 20:01 Lon Hohberger
  2011-08-11 20:07 ` Chris Feist
  0 siblings, 1 reply; 2+ messages in thread
From: Lon Hohberger @ 2011-08-08 20:01 UTC (permalink / raw)
  To: cluster-devel.redhat.com

Resolves: rhbz#678467

Signed-off-by: Lon Hohberger <lhh@redhat.com>
---
 rgmanager/src/resources/fs.sh.in        |    3 ++-
 rgmanager/src/resources/netfs.sh        |    3 ++-
 rgmanager/src/resources/utils/fs-lib.sh |   12 ++++++++++--
 3 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/rgmanager/src/resources/fs.sh.in b/rgmanager/src/resources/fs.sh.in
index 806a5d6..3e1cc15 100644
--- a/rgmanager/src/resources/fs.sh.in
+++ b/rgmanager/src/resources/fs.sh.in
@@ -445,7 +445,8 @@ do_force_unmount() {
 		export nfslock_reclaim=1
 	fi
 
-	return 0
+	# Proceed with fuser -kvm...
+	return 1
 }
 
 
diff --git a/rgmanager/src/resources/netfs.sh b/rgmanager/src/resources/netfs.sh
index f911ae2..52cefc4 100644
--- a/rgmanager/src/resources/netfs.sh
+++ b/rgmanager/src/resources/netfs.sh
@@ -354,12 +354,13 @@ do_force_unmount() {
 	nfs|nfs4)
 		ocf_log warning "Calling 'umount -f $mp'"
 		umount -f "$OCF_RESKEY_mountpoint"
+		return $?
 		;;
 	*)
 		;;
 	esac
 
-	return 0	# Returning 0 lets stop_filesystem do add'l checks
+	return 1	# Returning 1 lets stop_filesystem do add'l checks
 }
 
 
diff --git a/rgmanager/src/resources/utils/fs-lib.sh b/rgmanager/src/resources/utils/fs-lib.sh
index 38c242d..163cfb7 100644
--- a/rgmanager/src/resources/utils/fs-lib.sh
+++ b/rgmanager/src/resources/utils/fs-lib.sh
@@ -543,8 +543,10 @@ do_post_unmount() {
 
 
 # Agent-specific force-unmount logic, if required
+# return = nonzero if successful, or 0 if unsuccessful
+# (unsuccessful = try harder)
 do_force_unmount() {
-	return 0
+	return 1
 }
 
 
@@ -811,6 +813,13 @@ stop: Could not match $OCF_RESKEY_device with a real device"
 
 		# Force unmount: try #1: send SIGTERM
 		if [ $try -eq 1 ]; then
+			# Try fs-specific force-unmount, if provided
+			do_force_unmount
+			if [ $? -eq 0 ]; then
+				# if this succeeds, we should be done
+				continue
+			fi
+
 			ocf_log warning "Sending SIGTERM to processes on $mp"
 			fuser -TERM -kvm "$mp"
 			continue
@@ -818,7 +827,6 @@ stop: Could not match $OCF_RESKEY_device with a real device"
 			ocf_log warning "Sending SIGKILL to processes on $mp"
 			fuser -kvm "$mp"
 
-			do_force_unmount
 			case $? in
 			0)
 				;;
-- 
1.7.3.4



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [Cluster-devel] [PATCH] Low: Improve netfs unmount when server is unavailable [RHEL6]
  2011-08-08 20:01 [Cluster-devel] [PATCH] Low: Improve netfs unmount when server is unavailable [RHEL6] Lon Hohberger
@ 2011-08-11 20:07 ` Chris Feist
  0 siblings, 0 replies; 2+ messages in thread
From: Chris Feist @ 2011-08-11 20:07 UTC (permalink / raw)
  To: cluster-devel.redhat.com

ACK

On 08/08/11 15:01, Lon Hohberger wrote:
> Resolves: rhbz#678467
>
> Signed-off-by: Lon Hohberger<lhh@redhat.com>
> ---
>   rgmanager/src/resources/fs.sh.in        |    3 ++-
>   rgmanager/src/resources/netfs.sh        |    3 ++-
>   rgmanager/src/resources/utils/fs-lib.sh |   12 ++++++++++--
>   3 files changed, 14 insertions(+), 4 deletions(-)
>
> diff --git a/rgmanager/src/resources/fs.sh.in b/rgmanager/src/resources/fs.sh.in
> index 806a5d6..3e1cc15 100644
> --- a/rgmanager/src/resources/fs.sh.in
> +++ b/rgmanager/src/resources/fs.sh.in
> @@ -445,7 +445,8 @@ do_force_unmount() {
>   		export nfslock_reclaim=1
>   	fi
>
> -	return 0
> +	# Proceed with fuser -kvm...
> +	return 1
>   }
>
>
> diff --git a/rgmanager/src/resources/netfs.sh b/rgmanager/src/resources/netfs.sh
> index f911ae2..52cefc4 100644
> --- a/rgmanager/src/resources/netfs.sh
> +++ b/rgmanager/src/resources/netfs.sh
> @@ -354,12 +354,13 @@ do_force_unmount() {
>   	nfs|nfs4)
>   		ocf_log warning "Calling 'umount -f $mp'"
>   		umount -f "$OCF_RESKEY_mountpoint"
> +		return $?
>   		;;
>   	*)
>   		;;
>   	esac
>
> -	return 0	# Returning 0 lets stop_filesystem do add'l checks
> +	return 1	# Returning 1 lets stop_filesystem do add'l checks
>   }
>
>
> diff --git a/rgmanager/src/resources/utils/fs-lib.sh b/rgmanager/src/resources/utils/fs-lib.sh
> index 38c242d..163cfb7 100644
> --- a/rgmanager/src/resources/utils/fs-lib.sh
> +++ b/rgmanager/src/resources/utils/fs-lib.sh
> @@ -543,8 +543,10 @@ do_post_unmount() {
>
>
>   # Agent-specific force-unmount logic, if required
> +# return = nonzero if successful, or 0 if unsuccessful
> +# (unsuccessful = try harder)
>   do_force_unmount() {
> -	return 0
> +	return 1
>   }
>
>
> @@ -811,6 +813,13 @@ stop: Could not match $OCF_RESKEY_device with a real device"
>
>   		# Force unmount: try #1: send SIGTERM
>   		if [ $try -eq 1 ]; then
> +			# Try fs-specific force-unmount, if provided
> +			do_force_unmount
> +			if [ $? -eq 0 ]; then
> +				# if this succeeds, we should be done
> +				continue
> +			fi
> +
>   			ocf_log warning "Sending SIGTERM to processes on $mp"
>   			fuser -TERM -kvm "$mp"
>   			continue
> @@ -818,7 +827,6 @@ stop: Could not match $OCF_RESKEY_device with a real device"
>   			ocf_log warning "Sending SIGKILL to processes on $mp"
>   			fuser -kvm "$mp"
>
> -			do_force_unmount
>   			case $? in
>   			0)
>   				;;



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-08-11 20:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-08 20:01 [Cluster-devel] [PATCH] Low: Improve netfs unmount when server is unavailable [RHEL6] Lon Hohberger
2011-08-11 20:07 ` Chris Feist

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).