From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756874AbbIDIFg (ORCPT ); Fri, 4 Sep 2015 04:05:36 -0400 Received: from mail-wi0-f174.google.com ([209.85.212.174]:36948 "EHLO mail-wi0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752114AbbIDIFR (ORCPT ); Fri, 4 Sep 2015 04:05:17 -0400 Message-ID: <55E950BA.50203@bjorling.me> Date: Fri, 04 Sep 2015 10:05:14 +0200 From: =?UTF-8?B?TWF0aWFzIEJqw7hybGluZw==?= Organization: Paletta User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Dongsheng Yang , hch@infradead.org, axboe@fb.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org CC: jg@lightnvm.io, Stephen.Bates@pmcs.com, keith.busch@intel.com, =?UTF-8?B?TWF0aWFzIEJqw7hybGluZw==?= Subject: Re: [PATCH v7 1/5] lightnvm: Support for Open-Channel SSDs References: <1438957791-24632-1-git-send-email-mb@lightnvm.io> <1438957791-24632-2-git-send-email-mb@lightnvm.io> <55E67218.9010701@cn.fujitsu.com> <55E6D41A.5060100@bjorling.me> <55E94301.3010501@cn.fujitsu.com> In-Reply-To: <55E94301.3010501@cn.fujitsu.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > So here is a suggestion, register_bm again > if we found nvm_dev->bm == NULL in create_target(). And if it is still > NULL after that. return an error "nvm: no compatible bm was found" > and stop target creating. Otherwise, there would be a NULL Pointer > reference problem. > > That's a real problem I met in my testing and I did this change > in my local using. I hope that's useful to you. > Hi Yang, Similar to this? diff --git i/drivers/lightnvm/core.c w/drivers/lightnvm/core.c index 5e4c2b8..0d2e5e3 100644 --- i/drivers/lightnvm/core.c +++ w/drivers/lightnvm/core.c @@ -262,8 +262,9 @@ int nvm_init(struct nvm_dev *dev) } if (!ret) { - pr_info("nvm: no compatible bm was found.\n"); - return 0; + pr_info("nvm: %s was not initialized due to no compatible bm.\n", + dev->name); + return -EINVAL; } pr_info("nvm: registered %s with luns: %u blocks: %lu sector size: %d\n",