* Tue Aug 11 2015 Andrew Price <anprice@redhat.com> - 3.1.8-4

- gfs2-utils: Fix hang on withdraw
- Install udev withdraw handler scripts
This commit is contained in:
Andrew Price 2015-08-11 19:41:05 +01:00
parent 4f06f7e039
commit b4080e636c
2 changed files with 110 additions and 1 deletions

View File

@ -12,7 +12,7 @@
Name: gfs2-utils
Version: 3.1.8
Release: 3%{?dist}
Release: 4%{?dist}
License: GPLv2+ and LGPLv2+
Group: System Environment/Kernel
Summary: Utilities for managing the global file system (GFS2)
@ -32,10 +32,12 @@ BuildRequires: check-devel
Source: https://fedorahosted.org/released/gfs2-utils/gfs2-utils-%{version}.tar.gz
URL: https://fedorahosted.org/cluster/wiki/HomePage
Patch0: fsck_gfs2_replace_recent_i_goal_fixes_with_simple_logic.patch
Patch1: gfs2_utils_Fix_hang_on_withdraw.patch
%prep
%setup -q -n gfs2-utils-%{version}
%patch0 -p 1 -b .fsck_gfs2_replace_recent_i_goal_fixes_with_simple_logic
%patch1 -p 1 -b .gfs2_utils_Fix_hang_on_withdraw
%build
./autogen.sh
@ -52,6 +54,10 @@ rm -f %{buildroot}/usr/sbin/gfs2_trace
rm -f %{buildroot}/usr/sbin/gfs2_lockcapture
rm -f %{buildroot}%{_mandir}/man8/gfs2_trace.8
rm -f %{buildroot}%{_mandir}/man8/gfs2_lockcapture.8
# Install withdraw helper scripts
install -m 755 gfs2/scripts/gfs2_wd_udev.sh %{buildroot}%{_sbindir}/
install -D -m 644 gfs2/scripts/82-gfs2-withdraw.rules \
%{buildroot}%{_prefix}/lib/udev/rules.d/82-gfs2-withdraw.rules
%description
The gfs2-utils package contains a number of utilities for creating,
@ -68,10 +74,16 @@ file systems.
%{_sbindir}/gfs2_convert
%{_sbindir}/gfs2_edit
%{_sbindir}/tunegfs2
%{_sbindir}/gfs2_wd_udev.sh
%{_mandir}/man8/*gfs2*
%{_mandir}/man5/*
%{_prefix}/lib/udev/rules.d/82-gfs2-withdraw.rules
%changelog
* Tue Aug 11 2015 Andrew Price <anprice@redhat.com> - 3.1.8-4
- gfs2-utils: Fix hang on withdraw
- Install udev withdraw handler scripts
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.1.8-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

View File

@ -0,0 +1,97 @@
commit 4e9a8f12b74d61314e79904a0f02e42e99a98493
Author: Abhi Das <adas@redhat.com>
Date: 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@redhat.com>
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