Fix DRBD regression
Subsystems (2)
Philipp Reisner
maintainerPATCH 1/1 Fix DRBD regression
Hi Jens,
In 3.13 the commit 786235eeb 'kthread: make kthread_create() killable' broke DRBD's fence peer mechanism in a subtle way. Since only a part of our user base has fencing properly configured this regression was unnoticed until now. Please consider to submit this for 3.16-rc5.
Thanks,
Phil
Lars Ellenberg (1):
drbd: fix regression 'out of mem, failed to invoke fence-peer helper'
drivers/block/drbd/drbd_nl.c | 6 ++++++ 1 file changed, 6 insertions(+)
Signature · 1 line
1.9.1
Philipp Reisner
maintainerPATCH 1/1 drbd: fix regression 'out of mem, failed to invoke fence-peer helper'
From: Lars Ellenberg <[email protected]>
Since linux kernel 3.13, kthread_run() internally uses wait_for_completion_killable(). We sometimes may use kthread_run() while we still have a signal pending, which we used to kick our threads out of potentially blocking network functions, causing kthread_run() to mistake that as a new fatal signal and fail.
Fix: flush_signals() before kthread_run().
--- drivers/block/drbd/drbd_nl.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/block/drbd/drbd_nl.c +6 -0
@@ -544,6 +544,12 @@ void conn_try_outdate_peer_async(struct drbd_connection *connection)struct task_struct *opa;kref_get (&connection->kref); +/* We may just have force_sig()'ed this thread +* to get it out of some blocking network function. +* Clear signals; otherwise kthread_run(), which internally uses +* wait_on_completion_killable(), will mistake our pending signal +* for a new fatal signal and fail. */ +flush_signals (current); opa =kthread_run (_try_outdate_peer_async, connection,"drbd_async_h" );if (IS_ERR (opa)) {drbd_err (connection,"out of mem, failed to invoke fence-peer helper\n" );
Signature · 1 line
1.9.1
Jens Axboe
maintainerRe: [PATCH] drbd: fix regression 'out of mem, failed to invoke fence-peer helper'
Quoted 9 lines · Philipp Reisner
From: Lars Ellenberg <[email protected]>
Since linux kernel 3.13,
kthread_run()internally useswait_for_completion_killable(). We sometimes may usekthread_run()while we still have a signal pending, which we used to kick our threads out of potentially blocking network functions, causingkthread_run()to mistake that as a new fatal signal and fail.Fix:
flush_signals()beforekthread_run().
Applied - should this have been marked stable, if it affects 3..13+ kernels?
Signature · 1 line
Jens Axboe
Philipp Reisner
maintainerRe: [PATCH] drbd: fix regression 'out of mem, failed to invoke fence-peer helper'
Am Donnerstag, 10. Juli 2014, 11:07:22 schrieb Jens Axboe:
Quoted 9 lines · Philipp Reisner
Quoted 8 lines
From: Lars Ellenberg <[email protected]>
Since linux kernel 3.13,
kthread_run()internally useswait_for_completion_killable(). We sometimes may usekthread_run()while we still have a signal pending, which we used to kick our threads out of potentially blocking network functions, causingkthread_run()to mistake that as a new fatal signal and fail.
Quoted 3 lines
Quoted 1 line
Fix:
flush_signals()beforekthread_run().Applied - should this have been marked stable, if it affects 3..13+ kernels?
Yes, you are right. It should go to the stable kernels since 3.13 as well.
What is the correct way for me to mark it as stable when sending a patch?
-phil
Jens Axboe
maintainerRe: [PATCH] drbd: fix regression 'out of mem, failed to invoke fence-peer helper'
Quoted 10 lines · Philipp Reisner
Am Donnerstag, 10. Juli 2014, 11:07:22 schrieb Jens Axboe:
Quoted 9 lines · Philipp Reisner
Quoted 8 lines
From: Lars Ellenberg <[email protected]>
Since linux kernel 3.13,
kthread_run()internally useswait_for_completion_killable(). We sometimes may usekthread_run()while we still have a signal pending, which we used to kick our threads out of potentially blocking network functions, causingkthread_run()to mistake that as a new fatal signal and fail.
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
Fix:
flush_signals()beforekthread_run().Applied - should this have been marked stable, if it affects 3..13+ kernels?
Yes, you are right. It should go to the stable kernels since 3.13 as well.
Alright, we'll have to notify Greg/stable when it goes in.
Quoted 1 line
What is the correct way for me to mark it as stable when sending a patch?
You just add a:
where the signed-off-by is. If you know the versions it should be applied to, you can add that information as well. For this case, you would have done:
to get it into 3.13 stable and later.
Signature · 1 line
Jens Axboe