All of lore.kernel.org
 help / color / mirror / Atom feed
From: <gregkh@linuxfoundation.org>
To: bart.vanassche@sandisk.com, gregkh@linuxfoundation.org, tj@kernel.org
Cc: <stable@vger.kernel.org>, <stable-commits@vger.kernel.org>
Subject: Patch "blkcg: Unlock blkcg_pol_mutex only once when cpd == NULL" has been added to the 4.8-stable tree
Date: Wed, 26 Oct 2016 11:24:56 +0200	[thread overview]
Message-ID: <1477473896240249@kroah.com> (raw)


This is a note to let you know that I've just added the patch titled

    blkcg: Unlock blkcg_pol_mutex only once when cpd == NULL

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:
     blkcg-unlock-blkcg_pol_mutex-only-once-when-cpd-null.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 bbb427e342495df1cda10051d0566388697499c0 Mon Sep 17 00:00:00 2001
From: Bart Van Assche <bart.vanassche@sandisk.com>
Date: Thu, 29 Sep 2016 08:33:30 -0700
Subject: blkcg: Unlock blkcg_pol_mutex only once when cpd == NULL

From: Bart Van Assche <bart.vanassche@sandisk.com>

commit bbb427e342495df1cda10051d0566388697499c0 upstream.

Unlocking a mutex twice is wrong. Hence modify blkcg_policy_register()
such that blkcg_pol_mutex is unlocked once if cpd == NULL. This patch
avoids that smatch reports the following error:

block/blk-cgroup.c:1378: blkcg_policy_register() error: double unlock 'mutex:&blkcg_pol_mutex'

Fixes: 06b285bd1125 ("blkcg: fix blkcg_policy_data allocation bug")
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Cc: Tejun Heo <tj@kernel.org>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 block/blk-cgroup.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

--- a/block/blk-cgroup.c
+++ b/block/blk-cgroup.c
@@ -1340,10 +1340,8 @@ int blkcg_policy_register(struct blkcg_p
 			struct blkcg_policy_data *cpd;
 
 			cpd = pol->cpd_alloc_fn(GFP_KERNEL);
-			if (!cpd) {
-				mutex_unlock(&blkcg_pol_mutex);
+			if (!cpd)
 				goto err_free_cpds;
-			}
 
 			blkcg->cpd[pol->plid] = cpd;
 			cpd->blkcg = blkcg;


Patches currently in stable-queue which might be from bart.vanassche@sandisk.com are

queue-4.8/ib-srp-fix-infinite-loop-when-fmr-sg.offset-0.patch
queue-4.8/dm-rq-take-request_queue-lock-while-clearing-queue_flag_stopped.patch
queue-4.8/ib-core-correctly-handle-rdma_rw_init_mrs-failure.patch
queue-4.8/dm-mark-request_queue-dead-before-destroying-the-dm-device.patch
queue-4.8/dm-mpath-check-if-path-s-request_queue-is-dying-in-activate_path.patch
queue-4.8/blkcg-unlock-blkcg_pol_mutex-only-once-when-cpd-null.patch

                 reply	other threads:[~2016-10-26  9:24 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1477473896240249@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=bart.vanassche@sandisk.com \
    --cc=stable-commits@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=tj@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.