linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
To: Marius Kittler <mariuskittler@gmx.de>
Cc: linux-raid@vger.kernel.org
Subject: Re: [PATCH] Print concrete error when creating mddev
Date: Tue, 26 Apr 2022 16:38:23 +0200	[thread overview]
Message-ID: <20220426163823.000024dc@linux.intel.com> (raw)
In-Reply-To: <20220425132745.7952-1-mariuskittler@gmx.de>

On Mon, 25 Apr 2022 15:27:45 +0200
Marius Kittler <mariuskittler@gmx.de> wrote:

> Example from my testing:
> ```
> mdadm: unexpected failure opening /dev/md127: No such device or address
> ```
> 
> Before it would just print:
> ```
> mdadm: unexpected failure opening /dev/md127

Hi Marius,
Thanks for the patch. Could you provide reproduction steps?

> diff --git a/util.c b/util.c
> index cc94f96e..7c8c0bb1 100644
> --- a/util.c
> +++ b/util.c
> @@ -1088,8 +1088,9 @@ int open_dev_excl(char *devnm)
>  	long delay = 1000;
> 
>  	sprintf(buf, "%d:%d", major(devid), minor(devid));
> +	int fd = -1;
>  	for (i = 0; i < 25; i++) {
> -		int fd = dev_open(buf, flags|O_EXCL);
> +		fd = dev_open(buf, flags|O_EXCL);
>  		if (fd >= 0)
>  			return fd;
>  		if (errno == EACCES && flags == O_RDWR) {
> @@ -1102,7 +1103,7 @@ int open_dev_excl(char *devnm)
>  		if (delay < 200000)
>  			delay *= 2;
>  	}
> -	return -1;
> +	return fd;

There is no change, it is just a refactor. If you really want to change that,
then please follow kernel coding style guide. Please also run checkpatch script
from kernel source.

Could you add Jes and Coly to CC in v2?

Thanks,
Mariusz

      reply	other threads:[~2022-04-26 14:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-25 13:27 [PATCH] Print concrete error when creating mddev Marius Kittler
2022-04-26 14:38 ` Mariusz Tkaczyk [this message]

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=20220426163823.000024dc@linux.intel.com \
    --to=mariusz.tkaczyk@linux.intel.com \
    --cc=linux-raid@vger.kernel.org \
    --cc=mariuskittler@gmx.de \
    /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;
as well as URLs for NNTP newsgroup(s).