All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Menzel <pmenzel@molgen.mpg.de>
To: Logan Gunthorpe <logang@deltatee.com>
Cc: linux-raid@vger.kernel.org, Jes Sorensen <jes@trained-monkey.org>,
	Guoqing Jiang <guoqing.jiang@linux.dev>, Xiao Ni <xni@redhat.com>,
	Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>,
	Coly Li <colyli@suse.de>,
	Chaitanya Kulkarni <chaitanyak@nvidia.com>,
	Jonmichael Hands <jm@chia.net>,
	Stephen Bates <sbates@raithlin.com>,
	Martin Oliveira <Martin.Oliveira@eideticom.com>,
	David Sloan <David.Sloan@eideticom.com>,
	Kinga Tanska <kinga.tanska@linux.intel.com>,
	Chaitanya Kulkarni <kch@nvidia.com>
Subject: Re: [PATCH mdadm v7 4/7] mdadm: Introduce pr_info()
Date: Fri, 3 Mar 2023 11:35:21 +0100	[thread overview]
Message-ID: <a4929e12-a2da-be8f-7d24-9f7ae4abed59@molgen.mpg.de> (raw)
In-Reply-To: <20230301204135.39230-5-logang@deltatee.com>

Dear Logan,


Am 01.03.23 um 21:41 schrieb Logan Gunthorpe:
> Feedback was given to avoid informational pr_err() calls that print
> to stderr, even though that's done all through out the code.
> 
> Using printf() directly doesn't maintain the same format (an "mdadm"
> prefix on every line.

Just a nit, that the closing ) is missing.

In the summary you could use: Introduce and use pr_info()

> So introduce pr_info() which prints to stdout with the same format
> and use it for a couple informational pr_err() calls in Create().
> 
> Future work can make this call used in more cases.
> 
> Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
> Acked-by: Kinga Tanska <kinga.tanska@linux.intel.com>
> Reviewed-by: Xiao Ni <xni@redhat.com>
> Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
> Acked-by: Coly Li <colyli@suse.de>
> ---
>   Create.c | 7 ++++---
>   mdadm.h  | 2 ++
>   2 files changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/Create.c b/Create.c
> index 6a0446644e04..4acda30c5256 100644
> --- a/Create.c
> +++ b/Create.c
> @@ -984,11 +984,12 @@ int Create(struct supertype *st, char *mddev,
>   
>   			mdi = sysfs_read(-1, devnm, GET_VERSION);
>   
> -			pr_err("Creating array inside %s container %s\n",
> +			pr_info("Creating array inside %s container %s\n",
>   				mdi?mdi->text_version:"managed", devnm);
>   			sysfs_free(mdi);
>   		} else
> -			pr_err("Defaulting to version %s metadata\n", info.text_version);
> +			pr_info("Defaulting to version %s metadata\n",
> +				info.text_version);
>   	}
>   
>   	map_update(&map, fd2devnm(mdfd), info.text_version,
> @@ -1145,7 +1146,7 @@ int Create(struct supertype *st, char *mddev,
>   			ioctl(mdfd, RESTART_ARRAY_RW, NULL);
>   		}
>   		if (c->verbose >= 0)
> -			pr_err("array %s started.\n", mddev);
> +			pr_info("array %s started.\n", mddev);
>   		if (st->ss->external && st->container_devnm[0]) {
>   			if (need_mdmon)
>   				start_mdmon(st->container_devnm);
> diff --git a/mdadm.h b/mdadm.h
> index 13f8b4cb5a6b..8bd65fba1887 100644
> --- a/mdadm.h
> +++ b/mdadm.h
> @@ -1852,6 +1852,8 @@ static inline int xasprintf(char **strp, const char *fmt, ...) {
>   #endif
>   #define cont_err(fmt ...) fprintf(stderr, "       " fmt)
>   
> +#define pr_info(fmt, args...) printf("%s: "fmt, Name, ##args)
> +
>   void *xmalloc(size_t len);
>   void *xrealloc(void *ptr, size_t len);
>   void *xcalloc(size_t num, size_t size);

Acked-by: Paul Menzel <pmenzel@molgen.mpg.de>


Kind regards,

Paul

  reply	other threads:[~2023-03-03 10:35 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-01 20:41 [PATCH mdadm v7 0/7] Write Zeroes option for Creating Arrays Logan Gunthorpe
2023-03-01 20:41 ` [PATCH mdadm v7 1/7] Create: goto abort_locked instead of return 1 in error path Logan Gunthorpe
2023-03-01 20:41 ` [PATCH mdadm v7 2/7] Create: remove safe_mode_delay local variable Logan Gunthorpe
2023-03-01 20:41 ` [PATCH mdadm v7 3/7] Create: Factor out add_disks() helpers Logan Gunthorpe
2023-03-01 20:41 ` [PATCH mdadm v7 4/7] mdadm: Introduce pr_info() Logan Gunthorpe
2023-03-03 10:35   ` Paul Menzel [this message]
2023-03-01 20:41 ` [PATCH mdadm v7 5/7] mdadm: Add --write-zeros option for Create Logan Gunthorpe
2023-03-03  8:35   ` Coly Li
2023-03-01 20:41 ` [PATCH mdadm v7 6/7] tests/00raid5-zero: Introduce test to exercise --write-zeros Logan Gunthorpe
2023-03-01 20:41 ` [PATCH mdadm v7 7/7] manpage: Add --write-zeroes option to manpage Logan Gunthorpe
     [not found] ` <CABdXBAOAJAPmKC66WNnJSL5N72JZiM=AWBxhu_Yi1ojz3jn_Jg@mail.gmail.com>
2023-03-02  2:53   ` [PATCH mdadm v7 0/7] Write Zeroes option for Creating Arrays Chaitanya Kulkarni
2023-03-02  2:55 ` Chaitanya Kulkarni
2023-03-02 16:56 ` Martin K. Petersen
2023-03-13 14:08 ` Jes Sorensen

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=a4929e12-a2da-be8f-7d24-9f7ae4abed59@molgen.mpg.de \
    --to=pmenzel@molgen.mpg.de \
    --cc=David.Sloan@eideticom.com \
    --cc=Martin.Oliveira@eideticom.com \
    --cc=chaitanyak@nvidia.com \
    --cc=colyli@suse.de \
    --cc=guoqing.jiang@linux.dev \
    --cc=jes@trained-monkey.org \
    --cc=jm@chia.net \
    --cc=kch@nvidia.com \
    --cc=kinga.tanska@linux.intel.com \
    --cc=linux-raid@vger.kernel.org \
    --cc=logang@deltatee.com \
    --cc=mariusz.tkaczyk@linux.intel.com \
    --cc=sbates@raithlin.com \
    --cc=xni@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.