diff mbox

[10/14] blk-mq: Uninit hardware context in order reverse to init

Message ID cdf0bb66b4fa3bdcedb3bcd2df57ff38ed9fb02c.1474183901.git.agordeev@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Alexander Gordeev Sept. 18, 2016, 7:37 a.m. UTC
CC: linux-block@vger.kernel.org
Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
---
 block/blk-mq.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Omar Sandoval Sept. 19, 2016, 5:59 p.m. UTC | #1
On Sun, Sep 18, 2016 at 09:37:20AM +0200, Alexander Gordeev wrote:
> CC: linux-block@vger.kernel.org
> Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
> ---
>  block/blk-mq.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/block/blk-mq.c b/block/blk-mq.c
> index cd32a08..c589096 100644
> --- a/block/blk-mq.c
> +++ b/block/blk-mq.c
> @@ -2013,12 +2013,13 @@ static void blk_mq_realloc_hw_ctxs(struct blk_mq_tag_set *set,
>  		struct blk_mq_hw_ctx *hctx = hctxs[j];
>  
>  		if (hctx) {
> +			kobject_put(&hctx->kobj);
> +
>  			if (hctx->tags) {
>  				blk_mq_free_rq_map(set, hctx->tags, j);
>  				set->tags[j] = NULL;
>  			}
>  			blk_mq_exit_hctx(q, set, hctx, j);
> -			kobject_put(&hctx->kobj);
>  			hctxs[j] = NULL;
>  		}
>  	}

Oh, this fixes my comment from the last one, but it should be folded in
to be bisect-safe.
diff mbox

Patch

diff --git a/block/blk-mq.c b/block/blk-mq.c
index cd32a08..c589096 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -2013,12 +2013,13 @@  static void blk_mq_realloc_hw_ctxs(struct blk_mq_tag_set *set,
 		struct blk_mq_hw_ctx *hctx = hctxs[j];
 
 		if (hctx) {
+			kobject_put(&hctx->kobj);
+
 			if (hctx->tags) {
 				blk_mq_free_rq_map(set, hctx->tags, j);
 				set->tags[j] = NULL;
 			}
 			blk_mq_exit_hctx(q, set, hctx, j);
-			kobject_put(&hctx->kobj);
 			hctxs[j] = NULL;
 		}
 	}