Skip to contentSkip to conversation

Retry wait_event_interruptible in event of ERESTARTSYS

PATCH New Mark Syms 1 participant 2 messages Feb 1, 2019 Distributed lock manager (DLM)

lore
Share & tools
lore

Mark Syms

author
#0 lore raw

PATCH 1/1 Retry wait_event_interruptible in event of ERESTARTSYS

We saw an issue in a production server on a customer deployment where DLM 4.0.7 gets "stuck" and unable to join new lockspaces.

See - https://lists.clusterlabs.org/pipermail/users/2019-January/016054.html

This was forwarded off list to David Teigland who responded thusly.

"
Hi, thanks for the debugging info. You've spent more time looking at this than I have, but from a first glance it seems to me that the initial problem (there may be multiple) is that in the kernel, lockspace.c do_event() does not sensibly handle the ERESTARTSYS error from wait_event_interruptible(). I think do_event() should continue waiting for a uevent result from userspace until it gets one, because the kernel can't do anything sensible until it gets that.

Dave
"

This change does that. We have it running in automation with no problems so far but comments welcome.

Mark Syms (1):
Retry wait_event_interruptible in event of ERESTARTSYS

 fs/dlm/lockspace.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
Signature · 1 line
1.8.3.1
author
#1 lore raw

PATCH 1/1 Retry wait_event_interruptible in event of ERESTARTSYS

---
 fs/dlm/lockspace.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
fs/dlm/lockspace.c +4 -2
index db43b98..7aae23a 100644
@@ -210,8 +210,10 @@ static int do_uevent(struct dlm_ls *ls, int in)
 	/* dlm_controld will see the uevent, do the necessary group management
 	   and then write to sysfs to wake us */
 
-	error = wait_event_interruptible(ls->ls_uevent_wait,
-			test_and_clear_bit(LSFL_UEVENT_WAIT, &ls->ls_flags));
+	do {
+		error = wait_event_interruptible(ls->ls_uevent_wait,
+						 test_and_clear_bit(LSFL_UEVENT_WAIT, &ls->ls_flags));
+	} while (error == ERESTARTSYS);
 
 	log_rinfo(ls, "group event done %d %d", error, ls->ls_uevent_result);
 
Signature · 1 line
1.8.3.1