Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753453AbbFDOKy (ORCPT ); Thu, 4 Jun 2015 10:10:54 -0400 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:29084 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752081AbbFDOKv (ORCPT ); Thu, 4 Jun 2015 10:10:51 -0400 Message-ID: <55705C5E.9080401@fb.com> Date: Thu, 4 Jun 2015 08:10:38 -0600 From: Jens Axboe User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Ming Lei , Linux Kernel Mailing List CC: Stefan Seyfried , NeilBrown , Christoph Hellwig , "v4.0" Subject: Re: [PATCH] blk-mq: free hctx->ctxs in queue's release handler References: <1433423645-18901-1-git-send-email-tom.leiming@gmail.com> In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [192.168.54.13] X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.14.151,1.0.33,0.0.0000 definitions=2015-06-04_08:2015-06-03,2015-06-04,1970-01-01 signatures=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1023 Lines: 28 On 06/04/2015 07:19 AM, Ming Lei wrote: > On Thu, Jun 4, 2015 at 9:14 PM, Ming Lei wrote: >> Now blk_cleanup_queue() can be called before calling >> del_gendisk()[1], inside which hctx->ctxs is touched >> from blk_mq_unregister_hctx(), but the variable has >> been freed by blk_cleanup_queue() at that time. >> >> So this patch moves freeing of hctx->ctxs into queue's >> release handler for fixing the oops reported by Stefan. >> >> Also ctx's kobject is embedded into each ctx pointed by >> hctx->ctxs[], which shouldn't have been released so early. > > Hammm, the above line is wrong and should be removed, and > hctx->ctxs[] just stores the pointer of ctx. > > Jens, if you need v1, please let me know. Yeah, lets respin it please. -- Jens Axboe -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/