mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: jianyungao89@gmail.com
Cc: linux-kernel@vger.kernel.org, Dan Williams <djbw@kernel.org>,
	Vishal Verma <vishal.l.verma@intel.com>,
	Dave Jiang <dave.jiang@intel.com>,
	Alison Schofield <alison.schofield@intel.com>,
	nvdimm@lists.linux.dev (open list:DEVICE DIRECT ACCESS (DAX)),
	linux-cxl@vger.kernel.org (open list:DEVICE DIRECT ACCESS (DAX))
Subject: Re: [PATCH] dax: fix dax_core_init error return code
Date: Mon, 12 Oct 2026 15:28:30 +0100	[thread overview]
Message-ID: <20261012152830.5406d532@jic23-hlaptop> (raw)
In-Reply-To: <20261011132017.31131-1-jianyungao89@gmail.com>

On Sun, 11 Oct 2026 21:20:17 +0800
jianyungao89@gmail.com wrote:

> From: Jianyun Gao <jianyungao89@gmail.com>
> 
> dax_core_init() mistakenly returns 0 on error paths. Change the
> error return to use rc so the actual error code is propagated
> to the caller.

What is the user visible impact of this failing?

> 
> Fixes: 9567da0b408a ("device-dax: Introduce bus + driver model")
> Signed-off-by: Jianyun Gao <jianyungao89@gmail.com>
> ---
>  drivers/dax/super.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/dax/super.c b/drivers/dax/super.c
> index 45f84b0eb909..0f35f65363ee 100644
> --- a/drivers/dax/super.c
> +++ b/drivers/dax/super.c
> @@ -723,7 +723,7 @@ static int __init dax_core_init(void)
>  
>  	rc = dax_fs_init();
>  	if (rc)
> -		return rc;
> +		goto err_fs;
I don't see an advantage in this bit.  It is a fairly common preference
to error out directly where there is nothing to do.

>  
>  	rc = alloc_chrdev_region(&dax_devt, 0, MINORMASK+1, "dax");
>  	if (rc)
> @@ -738,7 +738,8 @@ static int __init dax_core_init(void)
>  	unregister_chrdev_region(dax_devt, MINORMASK+1);
>  err_chrdev:
>  	dax_fs_exit();
> -	return 0;
> +err_fs:
> +	return rc;
I'm not sure about this one.  Will need input from the DAX
folk on whether they were deliberately eating the error return
here. Not that I can immediately think of a reason to do so!

Jonathan


>  }
>  
>  static void __exit dax_core_exit(void)


  parent reply	other threads:[~2026-10-12 14:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-11 13:20 jianyungao89
2026-10-12 14:21 ` Markus Elfring
2026-10-12 14:28 ` Jonathan Cameron [this message]
2026-10-12 15:01   ` Jianyun Gao

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=20261012152830.5406d532@jic23-hlaptop \
    --to=jic23@kernel.org \
    --cc=alison.schofield@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=djbw@kernel.org \
    --cc=jianyungao89@gmail.com \
    --cc=linux-cxl@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nvdimm@lists.linux.dev \
    --cc=vishal.l.verma@intel.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

all inboxes | Powered by JetHome®