stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Patch "dm rq: clear kworker_task if kthread_run() returned an error" has been added to the 4.8-stable tree
@ 2016-11-08 16:46 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2016-11-08 16:46 UTC (permalink / raw)
  To: snitzer, gregkh, tahsin; +Cc: stable, stable-commits


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@vger.kernel.org> know about it.


>From 937fa62e8a00d0b4bc2c0a40567d7c88ab2b2e8d Mon Sep 17 00:00:00 2001
From: Mike Snitzer <snitzer@redhat.com>
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@redhat.com>

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@google.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 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@redhat.com 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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-11-08 16:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-08 16:46 Patch "dm rq: clear kworker_task if kthread_run() returned an error" has been added to the 4.8-stable tree gregkh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).