From: jes.sorensen@gmail.com
To: Zhilong Liu <zlliu@suse.com>
Cc: linux-raid@vger.kernel.org
Subject: Re: [PATCH] mdadm/Monitor:triggers core dump when stat2devnm return NULL
Date: Mon, 27 Mar 2017 18:25:20 -0400 [thread overview]
Message-ID: <wrfj7f3aichb.fsf@gmail.com> (raw)
In-Reply-To: <1489987301-22836-1-git-send-email-zlliu@suse.com> (Zhilong Liu's message of "Mon, 20 Mar 2017 13:21:41 +0800")
Zhilong Liu <zlliu@suse.com> writes:
> Monitor: ensure that the device should be a block
> device when uses --wait parameter, such as the 'f'
> and 'd' type file would be triggered core dumped.
> such as: ./mdadm --wait /dev/md/
I modified the patch description here to make it easier to read.
> Reviewed-by: NeilBrown <neilb@suse.com>
> Signed-off-by: Zhilong Liu <zlliu@suse.com>
> ---
> Monitor.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/Monitor.c b/Monitor.c
> index 802a9d9..f8850d3 100644
> --- a/Monitor.c
> +++ b/Monitor.c
> @@ -1002,7 +1002,12 @@ int Wait(char *dev)
> strerror(errno));
> return 2;
> }
> - strcpy(devnm, stat2devnm(&stb));
> + char *tmp = stat2devnm(&stb);
Please do not declare variables in the middle of the codeflow, that is
extremely bad programming practice.
I fixed this up and applied the patch.
Thanks,
Jes
prev parent reply other threads:[~2017-03-27 22:25 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-20 5:21 [PATCH] mdadm/Monitor:triggers core dump when stat2devnm return NULL Zhilong Liu
2017-03-27 22:25 ` jes.sorensen [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=wrfj7f3aichb.fsf@gmail.com \
--to=jes.sorensen@gmail.com \
--cc=linux-raid@vger.kernel.org \
--cc=zlliu@suse.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;
as well as URLs for NNTP newsgroup(s).