This is a note to let you know that I've just added the patch titled dm rq: clear kworker_task if kthread_run() returned an error to the 4.8-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: dm-rq-clear-kworker_task-if-kthread_run-returned-an-error.patch and it can be found in the queue-4.8 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 937fa62e8a00d0b4bc2c0a40567d7c88ab2b2e8d Mon Sep 17 00:00:00 2001 From: Mike Snitzer <snitzer@xxxxxxxxxx> Date: Tue, 18 Oct 2016 14:02:04 -0400 Subject: dm rq: clear kworker_task if kthread_run() returned an error From: Mike Snitzer <snitzer@xxxxxxxxxx> commit 937fa62e8a00d0b4bc2c0a40567d7c88ab2b2e8d upstream. cleanup_mapped_device() calls kthread_stop() if kworker_task is non-NULL. Currently the assigned value could be a valid task struct or an error code (e.g -ENOMEM). Reset md->kworker_task to NULL if kthread_run() returned an erorr. Fixes: 7193a9defc ("dm rq: check kthread_run return for .request_fn request-based DM") Reported-by: Tahsin Erdogan <tahsin@xxxxxxxxxx> Signed-off-by: Mike Snitzer <snitzer@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/md/dm-rq.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) --- a/drivers/md/dm-rq.c +++ b/drivers/md/dm-rq.c @@ -835,8 +835,11 @@ int dm_old_init_request_queue(struct map init_kthread_worker(&md->kworker); md->kworker_task = kthread_run(kthread_worker_fn, &md->kworker, "kdmwork-%s", dm_device_name(md)); - if (IS_ERR(md->kworker_task)) - return PTR_ERR(md->kworker_task); + if (IS_ERR(md->kworker_task)) { + int error = PTR_ERR(md->kworker_task); + md->kworker_task = NULL; + return error; + } elv_register_queue(md->queue); Patches currently in stable-queue which might be from snitzer@xxxxxxxxxx are queue-4.8/dm-free-io_barrier-after-blk_cleanup_queue-call.patch queue-4.8/dm-table-fix-missing-dm_put_target_type-in-dm_table_add_target.patch queue-4.8/dm-rq-clear-kworker_task-if-kthread_run-returned-an-error.patch queue-4.8/dm-mirror-fix-read-error-on-recovery-after-default-leg-failure.patch queue-4.8/dm-raid-fix-activation-of-existing-raid4-10-devices.patch queue-4.8/dm-raid-fix-compat_features-validation.patch -- To unsubscribe from this list: send the line "unsubscribe stable" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html