Gitweb: http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=06116f1663094…
Commit: 06116f1663094f0dfad88e9285ebd86d13f46248
Parent: c8387c1f4ef9ec52cceb52e89f89bdf464df5d40
Author: John Ruemker <jruemker(a)redhat.com>
AuthorDate: Thu Aug 27 16:04:11 2015 -0400
Committer: John Ruemker <jruemker(a)redhat.com>
CommitterDate: Thu Aug 27 16:04:11 2015 -0400
qdiskd: Watch for other nodes leaving while waiting for master reelection
With master_wins mode enabled, the master waits for reelection of
another node before the daemon will exit. However if another node
happens to leave while the master is waiting, the master does not
recognize the transition of that member to not-running, and thus
continues waiting for it to take over as master, when it never will
Signed-off-by: John Ruemker <jruemker(a)redhat.com>
---
cman/qdisk/main.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/cman/qdisk/main.c b/cman/qdisk/main.c
index c633442..f3c7307 100644
--- a/cman/qdisk/main.c
+++ b/cman/qdisk/main.c
@@ -1297,7 +1297,8 @@ quorum_reelect_master(qd_ctx *ctx, node_info_t *ni, int max)
read_node_blocks(ctx, ni, max);
for (x = 0; x < max; x++) {
- if (ni[x].ni_state >= S_RUN) {
+ if (ni[x].ni_status.ps_nodeid != ctx->qc_my_id &&
+ ni[x].ni_status.ps_state >= S_RUN) {
found = 1;
}
}
Gitweb: http://git.fedorahosted.org/git/?p=gfs2-utils.git;a=commitdiff;h=f26de35895…
Commit: f26de3589548a9fde9797e9f515b5b27de5a961d
Parent: c17455947281083e73567871ba1777d7ec135d4e
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Wed Aug 19 12:13:39 2015 +0100
Committer: Andrew Price <anprice(a)redhat.com>
CommitterDate: Thu Aug 20 15:58:10 2015 +0100
scripts: install the withdraw udev rules script
Add a --with-udevdir configure option and default to $prefix/lib/udev.
Note that we can't use $libdir for this as that will often be /usr/lib64
and the udevdir is arch-independent.
Also add the autoconf bits needed to install 82-gfs2-withdraw.rules into
$udevdir/rules.d
Resolves: rhbz#1225634
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
README.build | 5 ++---
configure.ac | 8 ++++++++
gfs2/scripts/Makefile.am | 4 ++--
3 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/README.build b/README.build
index acfde1b..d0a21c3 100644
--- a/README.build
+++ b/README.build
@@ -31,10 +31,9 @@ To install gfs2-utils, run:
The following scripts (located in gfs2/scripts) are used to complete
the userland portion of the gfs2 withdraw feature using uevents. They
-are not installed by 'make install' and need to be installed manually
-or during rpm installation to the corresponding locations.
+will be installed by 'make install' to these directories by default:
- 82-gfs2-withdraw.rules in /etc/udev/rules.d/
+ 82-gfs2-withdraw.rules in /usr/lib/udev/rules.d/
gfs2_withdraw_helper in /usr/sbin/
See also doc/README.contributing for details on submitting patches and
diff --git a/configure.ac b/configure.ac
index de96e5a..35cafe6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -110,6 +110,12 @@ if test -z "$ncurses_CFLAGS" && test -z "$ncurses_LIBS"; then
ncurses_LIBS=-lncurses
fi
+AC_ARG_WITH([udevdir],
+ AS_HELP_STRING([--with-udevdir=DIR],
+ [udev directory containing rules.d [default=${prefix}/lib/udev]]),
+ [], [with_udevdir=\${prefix}/lib/udev])
+AC_SUBST([udevdir], [$with_udevdir])
+
# Checks for header files.
AC_CHECK_HEADERS([fcntl.h libintl.h limits.h locale.h mntent.h stddef.h sys/file.h sys/ioctl.h sys/mount.h sys/time.h sys/vfs.h syslog.h termios.h])
AC_CHECK_HEADER([linux/fs.h], [], [AC_MSG_ERROR([Unable to find linux/fs.h])])
@@ -209,7 +215,9 @@ echo " Configure summary"
echo " ==================="
echo " prefix : $prefix"
echo " exec_prefix : $exec_prefix"
+echo " libdir : $libdir"
echo " sbindir : $sbindir"
+echo " udevdir : $udevdir"
echo " ------------------"
echo " debug build : $enable_debug"
echo " C unit tests : $have_check"
diff --git a/gfs2/scripts/Makefile.am b/gfs2/scripts/Makefile.am
index 056aaa5..d4bda04 100644
--- a/gfs2/scripts/Makefile.am
+++ b/gfs2/scripts/Makefile.am
@@ -5,6 +5,6 @@ dist_sbin_SCRIPTS = \
gfs2_trace \
gfs2_withdraw_helper
-noinst_SCRIPTS = \
+udevrulesdir=@udevdir@/rules.d
+dist_udevrules_DATA = \
82-gfs2-withdraw.rules
-
Gitweb: http://git.fedorahosted.org/git/?p=gfs2-utils.git;a=commitdiff;h=60db3c3651…
Commit: 60db3c365128dc8aa7e0d3c903c426c8a743b8e2
Parent: 40b872651561de2e8a06fdb1b792be8874e2b19a
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Tue Aug 18 12:35:52 2015 +0100
Committer: Andrew Price <anprice(a)redhat.com>
CommitterDate: Thu Aug 20 15:57:27 2015 +0100
scripts: rename gfs2_wd_udev.sh to gfs2_withdraw_helper
Makes the name more descriptive and consistent with the name of the udev
rules script.
Resolves: rhbz#1225634
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
README.build | 2 +-
gfs2/scripts/82-gfs2-withdraw.rules | 2 +-
gfs2/scripts/Makefile.am | 2 +-
gfs2/scripts/gfs2_wd_udev.sh | 30 ------------------------------
gfs2/scripts/gfs2_withdraw_helper | 30 ++++++++++++++++++++++++++++++
5 files changed, 33 insertions(+), 33 deletions(-)
diff --git a/README.build b/README.build
index 6487bae..acfde1b 100644
--- a/README.build
+++ b/README.build
@@ -35,7 +35,7 @@ are not installed by 'make install' and need to be installed manually
or during rpm installation to the corresponding locations.
82-gfs2-withdraw.rules in /etc/udev/rules.d/
- gfs2_wd_udev.sh in /usr/sbin/
+ gfs2_withdraw_helper in /usr/sbin/
See also doc/README.contributing for details on submitting patches and
doc/README.tests for more details regarding the test suite.
diff --git a/gfs2/scripts/82-gfs2-withdraw.rules b/gfs2/scripts/82-gfs2-withdraw.rules
index 2228615..2c9e0e8 100644
--- a/gfs2/scripts/82-gfs2-withdraw.rules
+++ b/gfs2/scripts/82-gfs2-withdraw.rules
@@ -1,2 +1,2 @@
-SUBSYSTEM=="gfs2", ACTION=="offline", RUN+="/bin/sh /usr/sbin/gfs2_wd_udev.sh"
+SUBSYSTEM=="gfs2", ACTION=="offline", RUN+="/bin/sh /usr/sbin/gfs2_withdraw_helper"
diff --git a/gfs2/scripts/Makefile.am b/gfs2/scripts/Makefile.am
index dde906f..51764fa 100644
--- a/gfs2/scripts/Makefile.am
+++ b/gfs2/scripts/Makefile.am
@@ -6,5 +6,5 @@ dist_sbin_SCRIPTS = \
noinst_SCRIPTS = \
82-gfs2-withdraw.rules \
- gfs2_wd_udev.sh
+ gfs2_withdraw_helper
diff --git a/gfs2/scripts/gfs2_wd_udev.sh b/gfs2/scripts/gfs2_wd_udev.sh
deleted file mode 100755
index ac3ce35..0000000
--- a/gfs2/scripts/gfs2_wd_udev.sh
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/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
diff --git a/gfs2/scripts/gfs2_withdraw_helper b/gfs2/scripts/gfs2_withdraw_helper
new file mode 100755
index 0000000..ac3ce35
--- /dev/null
+++ b/gfs2/scripts/gfs2_withdraw_helper
@@ -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
Gitweb: http://git.fedorahosted.org/git/?p=gfs2-utils.git;a=commitdiff;h=9aa261bd5e…
Commit: 9aa261bd5e65beb757b0953ba43211fc29641952
Parent: fdded71f349ec5928a1422bc7edaa7f4f6c0be26
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Wed Aug 19 12:13:39 2015 +0100
Committer: Andrew Price <anprice(a)redhat.com>
CommitterDate: Wed Aug 19 12:31:06 2015 +0100
scripts: install the withdraw udev rules script
Add a --with-udevdir configure option and default to $prefix/lib/udev.
Note that we can't use $libdir for this as that will often be /usr/lib64
and the udevdir is arch-independent.
Also add the autoconf bits needed to install 82-gfs2-withdraw.rules into
$udevdir/rules.d
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
README.build | 5 ++---
configure.ac | 8 ++++++++
gfs2/scripts/Makefile.am | 4 ++--
3 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/README.build b/README.build
index acfde1b..d0a21c3 100644
--- a/README.build
+++ b/README.build
@@ -31,10 +31,9 @@ To install gfs2-utils, run:
The following scripts (located in gfs2/scripts) are used to complete
the userland portion of the gfs2 withdraw feature using uevents. They
-are not installed by 'make install' and need to be installed manually
-or during rpm installation to the corresponding locations.
+will be installed by 'make install' to these directories by default:
- 82-gfs2-withdraw.rules in /etc/udev/rules.d/
+ 82-gfs2-withdraw.rules in /usr/lib/udev/rules.d/
gfs2_withdraw_helper in /usr/sbin/
See also doc/README.contributing for details on submitting patches and
diff --git a/configure.ac b/configure.ac
index de96e5a..35cafe6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -110,6 +110,12 @@ if test -z "$ncurses_CFLAGS" && test -z "$ncurses_LIBS"; then
ncurses_LIBS=-lncurses
fi
+AC_ARG_WITH([udevdir],
+ AS_HELP_STRING([--with-udevdir=DIR],
+ [udev directory containing rules.d [default=${prefix}/lib/udev]]),
+ [], [with_udevdir=\${prefix}/lib/udev])
+AC_SUBST([udevdir], [$with_udevdir])
+
# Checks for header files.
AC_CHECK_HEADERS([fcntl.h libintl.h limits.h locale.h mntent.h stddef.h sys/file.h sys/ioctl.h sys/mount.h sys/time.h sys/vfs.h syslog.h termios.h])
AC_CHECK_HEADER([linux/fs.h], [], [AC_MSG_ERROR([Unable to find linux/fs.h])])
@@ -209,7 +215,9 @@ echo " Configure summary"
echo " ==================="
echo " prefix : $prefix"
echo " exec_prefix : $exec_prefix"
+echo " libdir : $libdir"
echo " sbindir : $sbindir"
+echo " udevdir : $udevdir"
echo " ------------------"
echo " debug build : $enable_debug"
echo " C unit tests : $have_check"
diff --git a/gfs2/scripts/Makefile.am b/gfs2/scripts/Makefile.am
index 056aaa5..d4bda04 100644
--- a/gfs2/scripts/Makefile.am
+++ b/gfs2/scripts/Makefile.am
@@ -5,6 +5,6 @@ dist_sbin_SCRIPTS = \
gfs2_trace \
gfs2_withdraw_helper
-noinst_SCRIPTS = \
+udevrulesdir=@udevdir@/rules.d
+dist_udevrules_DATA = \
82-gfs2-withdraw.rules
-
Gitweb: http://git.fedorahosted.org/git/?p=gfs2-utils.git;a=commitdiff;h=bdb6bb67ee…
Commit: bdb6bb67ee4532c2dfb65eeeebcec06bda99d4ff
Parent: 4e9a8f12b74d61314e79904a0f02e42e99a98493
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Tue Aug 18 12:35:52 2015 +0100
Committer: Andrew Price <anprice(a)redhat.com>
CommitterDate: Tue Aug 18 12:45:54 2015 +0100
scripts: rename gfs2_wd_udev.sh to gfs2_withdraw_helper
Makes the name more descriptive and consistent with the name of the udev
rules script.
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
README.build | 2 +-
gfs2/scripts/82-gfs2-withdraw.rules | 2 +-
gfs2/scripts/Makefile.am | 2 +-
gfs2/scripts/gfs2_wd_udev.sh | 30 ------------------------------
gfs2/scripts/gfs2_withdraw_helper | 30 ++++++++++++++++++++++++++++++
5 files changed, 33 insertions(+), 33 deletions(-)
diff --git a/README.build b/README.build
index 6487bae..acfde1b 100644
--- a/README.build
+++ b/README.build
@@ -35,7 +35,7 @@ are not installed by 'make install' and need to be installed manually
or during rpm installation to the corresponding locations.
82-gfs2-withdraw.rules in /etc/udev/rules.d/
- gfs2_wd_udev.sh in /usr/sbin/
+ gfs2_withdraw_helper in /usr/sbin/
See also doc/README.contributing for details on submitting patches and
doc/README.tests for more details regarding the test suite.
diff --git a/gfs2/scripts/82-gfs2-withdraw.rules b/gfs2/scripts/82-gfs2-withdraw.rules
index 2228615..2c9e0e8 100644
--- a/gfs2/scripts/82-gfs2-withdraw.rules
+++ b/gfs2/scripts/82-gfs2-withdraw.rules
@@ -1,2 +1,2 @@
-SUBSYSTEM=="gfs2", ACTION=="offline", RUN+="/bin/sh /usr/sbin/gfs2_wd_udev.sh"
+SUBSYSTEM=="gfs2", ACTION=="offline", RUN+="/bin/sh /usr/sbin/gfs2_withdraw_helper"
diff --git a/gfs2/scripts/Makefile.am b/gfs2/scripts/Makefile.am
index dde906f..51764fa 100644
--- a/gfs2/scripts/Makefile.am
+++ b/gfs2/scripts/Makefile.am
@@ -6,5 +6,5 @@ dist_sbin_SCRIPTS = \
noinst_SCRIPTS = \
82-gfs2-withdraw.rules \
- gfs2_wd_udev.sh
+ gfs2_withdraw_helper
diff --git a/gfs2/scripts/gfs2_wd_udev.sh b/gfs2/scripts/gfs2_wd_udev.sh
deleted file mode 100755
index ac3ce35..0000000
--- a/gfs2/scripts/gfs2_wd_udev.sh
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/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
diff --git a/gfs2/scripts/gfs2_withdraw_helper b/gfs2/scripts/gfs2_withdraw_helper
new file mode 100755
index 0000000..ac3ce35
--- /dev/null
+++ b/gfs2/scripts/gfs2_withdraw_helper
@@ -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
Gitweb: http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=c8387c1f4ef9e…
Commit: c8387c1f4ef9ec52cceb52e89f89bdf464df5d40
Parent: 75fa0e0b3bdb82b368cd71f5fa43b8705aa93357
Author: John Ruemker <jruemker(a)redhat.com>
AuthorDate: Wed Aug 12 12:09:32 2015 -0400
Committer: John Ruemker <jruemker(a)redhat.com>
CommitterDate: Wed Aug 12 12:09:32 2015 -0400
fencelib: Remove action from fencedevice params with fence_node -S
fence_node -S intends to execute the fence methods for a given node, but
using action=status. As we are compiling the argument list, we properly
strip off any action attribute from the node-specific attributes pulled
from the configuration, however we do not do the same for fencedevice
attributes. If action=off or action=reboot is specified in the fencedevice
attributes, fence_node -S will retain that action and can power off a node
unexpectedly.
---
fence/libfence/agent.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/fence/libfence/agent.c b/fence/libfence/agent.c
index fac6c92..92c78f9 100644
--- a/fence/libfence/agent.c
+++ b/fence/libfence/agent.c
@@ -887,6 +887,11 @@ static int make_args_status(int cd, char *victim, char *method, int d,
continue;
}
+ if (!strncmp(str, "action=", 7)) {
+ free(str);
+ continue;
+ }
+
ret = snprintf(args + pos, len - pos, "%s\n", str);
free(str);
Gitweb: http://git.fedorahosted.org/git/?p=gfs2-utils.git;a=commitdiff;h=40b8726515…
Commit: 40b872651561de2e8a06fdb1b792be8874e2b19a
Parent: ce7b371a5ef76526eeba90b2eb62e1912d9b772f
Author: Abhi Das <adas(a)redhat.com>
AuthorDate: Tue Aug 4 11:00:51 2015 -0500
Committer: Abhi Das <adas(a)redhat.com>
CommitterDate: Tue Aug 4 13:30:06 2015 -0500
gfs2-utils: Fix hang on withdraw
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(a)redhat.com>
---
README.build | 9 +++++++++
gfs2/scripts/82-gfs2-withdraw.rules | 2 ++
gfs2/scripts/Makefile.am | 5 +++++
gfs2/scripts/gfs2_wd_udev.sh | 30 ++++++++++++++++++++++++++++++
4 files changed, 46 insertions(+), 0 deletions(-)
diff --git a/README.build b/README.build
index f4ebe53..6487bae 100644
--- a/README.build
+++ b/README.build
@@ -29,5 +29,14 @@ To install gfs2-utils, run:
make install
+The following scripts (located in gfs2/scripts) are used to complete
+the userland portion of the gfs2 withdraw feature using uevents. They
+are not installed by 'make install' and need to be installed manually
+or during rpm installation to the corresponding locations.
+
+ 82-gfs2-withdraw.rules in /etc/udev/rules.d/
+ gfs2_wd_udev.sh in /usr/sbin/
+
See also doc/README.contributing for details on submitting patches and
doc/README.tests for more details regarding the test suite.
+
diff --git a/gfs2/scripts/82-gfs2-withdraw.rules b/gfs2/scripts/82-gfs2-withdraw.rules
new file mode 100644
index 0000000..2228615
--- /dev/null
+++ b/gfs2/scripts/82-gfs2-withdraw.rules
@@ -0,0 +1,2 @@
+SUBSYSTEM=="gfs2", ACTION=="offline", RUN+="/bin/sh /usr/sbin/gfs2_wd_udev.sh"
+
diff --git a/gfs2/scripts/Makefile.am b/gfs2/scripts/Makefile.am
index 62fb2fe..dde906f 100644
--- a/gfs2/scripts/Makefile.am
+++ b/gfs2/scripts/Makefile.am
@@ -3,3 +3,8 @@ MAINTAINERCLEANFILES = Makefile.in
dist_sbin_SCRIPTS = \
gfs2_lockcapture \
gfs2_trace
+
+noinst_SCRIPTS = \
+ 82-gfs2-withdraw.rules \
+ 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
Gitweb: http://git.fedorahosted.org/git/?p=gfs2-utils.git;a=commitdiff;h=4e9a8f12b7…
Commit: 4e9a8f12b74d61314e79904a0f02e42e99a98493
Parent: 68927eb5fb3e6fa418de94eb929b79efc4fea3f6
Author: Abhi Das <adas(a)redhat.com>
AuthorDate: Tue Aug 4 11:00:51 2015 -0500
Committer: Abhi Das <adas(a)redhat.com>
CommitterDate: Tue Aug 4 11:00:51 2015 -0500
gfs2-utils: Fix hang on withdraw
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(a)redhat.com>
---
README.build | 9 +++++++++
gfs2/scripts/82-gfs2-withdraw.rules | 2 ++
gfs2/scripts/Makefile.am | 5 +++++
gfs2/scripts/gfs2_wd_udev.sh | 30 ++++++++++++++++++++++++++++++
4 files changed, 46 insertions(+), 0 deletions(-)
diff --git a/README.build b/README.build
index f4ebe53..6487bae 100644
--- a/README.build
+++ b/README.build
@@ -29,5 +29,14 @@ To install gfs2-utils, run:
make install
+The following scripts (located in gfs2/scripts) are used to complete
+the userland portion of the gfs2 withdraw feature using uevents. They
+are not installed by 'make install' and need to be installed manually
+or during rpm installation to the corresponding locations.
+
+ 82-gfs2-withdraw.rules in /etc/udev/rules.d/
+ gfs2_wd_udev.sh in /usr/sbin/
+
See also doc/README.contributing for details on submitting patches and
doc/README.tests for more details regarding the test suite.
+
diff --git a/gfs2/scripts/82-gfs2-withdraw.rules b/gfs2/scripts/82-gfs2-withdraw.rules
new file mode 100644
index 0000000..2228615
--- /dev/null
+++ b/gfs2/scripts/82-gfs2-withdraw.rules
@@ -0,0 +1,2 @@
+SUBSYSTEM=="gfs2", ACTION=="offline", RUN+="/bin/sh /usr/sbin/gfs2_wd_udev.sh"
+
diff --git a/gfs2/scripts/Makefile.am b/gfs2/scripts/Makefile.am
index 62fb2fe..dde906f 100644
--- a/gfs2/scripts/Makefile.am
+++ b/gfs2/scripts/Makefile.am
@@ -3,3 +3,8 @@ MAINTAINERCLEANFILES = Makefile.in
dist_sbin_SCRIPTS = \
gfs2_lockcapture \
gfs2_trace
+
+noinst_SCRIPTS = \
+ 82-gfs2-withdraw.rules \
+ 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