gfs2-utils: Fix hang on withdraw
PATCH 1/1 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
--- 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
gfs2/scripts/82-gfs2-withdraw.rules new file +2 -0
@@ -0,0 +1,2 @@ +SUBSYSTEM=="gfs2", ACTION=="offline", RUN+="/bin/sh /sbin/gfs2_wd_udev.sh" +
gfs2/scripts/gfs2_wd_udev.sh new file +30 -0
@@ -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
Signature · 1 line
2.4.3
PATCH 1/1 gfs2-utils: Fix hang on withdraw
Hi Abhi,
Quoted 12 lines · Abhijith Das
Issuing a withdraw on a gfs2 filesystem causes a hang. When
gfs_controldwas 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_controldused 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.
Quoted 8 lines
Resolves: rhbz#1225634
Signed-off-by Abhi Das <[email protected]>--- 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
Even if they're not getting installed in 'make install' the build system will need to know about them, in gfs2/scripts/Makefile.am:
noinst_SCRIPTS = \ 82-gfs2-withdraw.rules \ gfs2_wd_udev.sh
I think some documentation in README.build would be useful too, so that package maintainers know why and where to install them.
gfs2/scripts/82-gfs2-withdraw.rules line 1
Quoted 7 lines
gfs2/scripts/82-gfs2-withdraw.rules new file +1
-0@@ -0,0 +1,2 @@ +SUBSYSTEM=="gfs2", ACTION=="offline", RUN+="/bin/sh /sbin/gfs2_wd_udev.sh"
Perhaps that should be /usr/sbin instead of /sbin, after the whole "UsrMove" thing.
Thanks,
Andy
Quoted 38 lines
gfs2/scripts/82-gfs2-withdraw.rules new file +1
-0+gfs2/scripts/gfs2_wd_udev.sh new file +30
-0@@ -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
PATCH 1/1 gfs2-utils: Fix hang on withdraw
----- Original Message -----
Quoted 39 lines
From: "Andrew Price" <[email protected]>
To: "Abhijith Das" <[email protected]>, "cluster-devel" <[email protected]>
Sent: Tuesday, August 4, 2015 6:06:16 AM
Subject: Re: [Cluster-devel] [GFS2 PATCH] gfs2-utils: Fix hang on withdrawHi Abhi,
Quoted 12 lines · Abhijith Das
Issuing a withdraw on a gfs2 filesystem causes a hang. When
gfs_controldwas 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_controldused 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.Quoted 8 lines
Resolves: rhbz#1225634
Signed-off-by Abhi Das <[email protected]>--- 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.shEven if they're not getting installed in 'make install' the build system will need to know about them, in gfs2/scripts/Makefile.am:
noinst_SCRIPTS = \ 82-gfs2-withdraw.rules \ gfs2_wd_udev.shI think some documentation in README.build would be useful too, so that package maintainers know why and where to install them.
Quoted 12 lines
gfs2/scripts/82-gfs2-withdraw.rules line 1
Quoted 8 lines
gfs2/scripts/82-gfs2-withdraw.rules new file +1
-0@@ -0,0 +1,2 @@ +SUBSYSTEM=="gfs2", ACTION=="offline", RUN+="/bin/sh /sbin/gfs2_wd_udev.sh"Perhaps that should be
/usr/sbininstead of /sbin, after the whole "UsrMove" thing.
Ok, Thanks! I'll make these changes and re-post.
Cheers!
--Abhi