From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755404AbbLDICy (ORCPT ); Fri, 4 Dec 2015 03:02:54 -0500 Received: from mail-ig0-f177.google.com ([209.85.213.177]:36536 "EHLO mail-ig0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755279AbbLDICw convert rfc822-to-8bit (ORCPT ); Fri, 4 Dec 2015 03:02:52 -0500 MIME-Version: 1.0 In-Reply-To: <1449058583-27940-1-git-send-email-m@bjorling.me> References: <1449058583-27940-1-git-send-email-m@bjorling.me> Date: Fri, 4 Dec 2015 16:02:51 +0800 Message-ID: Subject: Re: [PATCH RFC 1/3] lightnvm: check mm before use From: Wenwei Tao To: =?UTF-8?Q?Matias_Bj=C3=B8rling?= Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2015-12-02 20:16 GMT+08:00 Matias Bjørling : > The core can initialize I/Os before a media manager is registered with > the lightnvm subsystem. Make sure that we don't call the media manager > prematurely. > > Signed-off-by: Matias Bjørling > --- > drivers/nvme/host/lightnvm.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/nvme/host/lightnvm.c b/drivers/nvme/host/lightnvm.c > index 06c3364..762c9a7 100644 > --- a/drivers/nvme/host/lightnvm.c > +++ b/drivers/nvme/host/lightnvm.c > @@ -455,7 +455,7 @@ static void nvme_nvm_end_io(struct request *rq, int error) > struct nvm_rq *rqd = rq->end_io_data; > struct nvm_dev *dev = rqd->dev; > > - if (dev->mt->end_io(rqd, error)) > + if (dev->mt && dev->mt->end_io(rqd, error)) Is there any chance core can initialize IOs on device without register with a media manger ? In my understanding core cannot create target on device without a media manger, if core doesn't have a target how can core initialize IOs on these devices? If I'm wrong about this, please correct me.