cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
* [Cluster-devel] [GFS2 PATCH] gfs2-utils: Fix hang on withdraw
@ 2015-08-03 19:30 Abhijith Das
  2015-08-04 11:06 ` Andrew Price
  0 siblings, 1 reply; 3+ messages in thread
From: Abhijith Das @ 2015-08-03 19:30 UTC (permalink / raw)
  To: cluster-devel.redhat.com

Issuing a withdraw on a gfs2 filesystem causes a hang. When
gfs_controld was removed, the userspace functionality that
completes a withdraw operation went away. This causes gfs2
kernel to hang waiting for a withdraw completion ack from
userspace.

This patchset introduces a uevent-based shell script to do
the job that gfs_controld used to do on withdraw. An 'offline'
uevent triggers the execution of this script. This script
suspends the device associated with the filesystem and signals
a completed withdraw to the kernel.

Resolves: rhbz#1225634
Signed-off-by: Abhi Das <adas@redhat.com>
---
 gfs2/scripts/82-gfs2-withdraw.rules |  2 ++
 gfs2/scripts/gfs2_wd_udev.sh        | 30 ++++++++++++++++++++++++++++++
 2 files changed, 32 insertions(+)
 create mode 100644 gfs2/scripts/82-gfs2-withdraw.rules
 create mode 100755 gfs2/scripts/gfs2_wd_udev.sh

diff --git a/gfs2/scripts/82-gfs2-withdraw.rules b/gfs2/scripts/82-gfs2-withdraw.rules
new file mode 100644
index 0000000..c1ab02b
--- /dev/null
+++ b/gfs2/scripts/82-gfs2-withdraw.rules
@@ -0,0 +1,2 @@
+SUBSYSTEM=="gfs2", ACTION=="offline", RUN+="/bin/sh /sbin/gfs2_wd_udev.sh"
+
diff --git a/gfs2/scripts/gfs2_wd_udev.sh b/gfs2/scripts/gfs2_wd_udev.sh
new file mode 100755
index 0000000..ac3ce35
--- /dev/null
+++ b/gfs2/scripts/gfs2_wd_udev.sh
@@ -0,0 +1,30 @@
+#!/bin/sh
+#
+# Do not run this script manually. This script is called by udev on a gfs2
+# withdraw uevent and is used to complete the withdraw action and notify the
+# kernel.
+#
+
+# Sanity checks
+if [ "$SUBSYSTEM" != "gfs2" ] || [ "$LOCKPROTO" != "lock_dlm" ] ||
+       [ -z "$DEVPATH" ] || [ "$ACTION" != "offline" ]
+then
+    exit 1 # Nothing to do here
+fi
+
+# Try and suspend the device
+SYSFS_TOPDIR="/sys"$DEVPATH
+DM_NAME=$(cat "$SYSFS_TOPDIR/device/dm/name")
+DM_DEV="/dev/mapper/"$DM_NAME
+
+if [ -z "$DM_DEV" ]
+then
+    /usr/bin/dmsetup suspend $DM_DEV
+fi
+
+# Signal completion of withdraw
+WD_ACK="$SYSFS_TOPDIR/lock_module/withdraw"
+if [ -f "$WD_ACK" ]
+then
+    echo "1" > $WD_ACK
+fi
-- 
2.4.3



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

end of thread, other threads:[~2015-08-04 14:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-03 19:30 [Cluster-devel] [GFS2 PATCH] gfs2-utils: Fix hang on withdraw Abhijith Das
2015-08-04 11:06 ` Andrew Price
2015-08-04 14:40   ` Abhijith Das

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).