public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Matias Bjørling" <mb@lightnvm.io>
To: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Cc: linux-kernel@vger.kernel.org, linux-block@vger.kernel.org
Subject: Re: [PATCH v2 5/5] lightnvm: return error if manager not found
Date: Tue, 24 Nov 2015 12:10:25 +0100	[thread overview]
Message-ID: <565445A1.8000207@lightnvm.io> (raw)
In-Reply-To: <1448361300-26718-5-git-send-email-sudipm.mukherjee@gmail.com>

On 11/24/2015 11:35 AM, Sudip Mukherjee wrote:
> We were returning a success value even if a manager was not found.
>
> Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
> ---
>
> Not sure if it was intentionally done like that way. This patch is
> placed at the end so it will be easy to drop if i am wrong.
> Did this change seeing similar code in nvm_create_target().
>
>   drivers/lightnvm/core.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/lightnvm/core.c b/drivers/lightnvm/core.c
> index 9dd1623..c34d0cd 100644
> --- a/drivers/lightnvm/core.c
> +++ b/drivers/lightnvm/core.c
> @@ -264,7 +264,8 @@ static int nvm_init(struct nvm_dev *dev)
>
>   	if (!ret) {
>   		pr_info("nvm: no compatible manager found.\n");
> -		return 0;
> +		ret = -ENODEV;
> +		goto err;
>   	}
>
>   	pr_info("nvm: registered %s [%u/%u/%u/%u/%u/%u]\n",
>

It actually was. Negative values means error, zero means 
continue/ignore, and positive value means the manage was registered to it.

We want to stay initialized, even without a media manager. In the case a 
media manager module is loaded, any devices, without media manager 
attached, should be re-identified and properly instantiate with the 
newly loaded module. This logic is still missing though. Feel free to 
jump in and implement it.

Thanks for taking the time to look through the source.

  reply	other threads:[~2015-11-24 11:10 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-24 10:34 [PATCH v2 1/5] lightnvm: fix memory leak Sudip Mukherjee
2015-11-24 10:34 ` [PATCH v2 2/5] lightnvm: check for max sector Sudip Mukherjee
2015-11-24 11:00   ` Matias Bjørling
2015-11-24 10:34 ` [PATCH v2 3/5] lightnvm: create dma pool first Sudip Mukherjee
2015-11-24 11:01   ` Matias Bjørling
2015-11-24 10:34 ` [PATCH v2 4/5] lightnvm: release dev if dma pools fails Sudip Mukherjee
2015-11-24 11:06   ` Matias Bjørling
2015-11-24 10:35 ` [PATCH v2 5/5] lightnvm: return error if manager not found Sudip Mukherjee
2015-11-24 11:10   ` Matias Bjørling [this message]
2015-11-24 10:57 ` [PATCH v2 1/5] lightnvm: fix memory leak Matias Bjørling

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=565445A1.8000207@lightnvm.io \
    --to=mb@lightnvm.io \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sudipm.mukherjee@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox