From: Neil Brown <neilb@suse.de>
To: Krzysztof Wojcik <krzysztof.wojcik@intel.com>
Cc: linux-raid@vger.kernel.org, wojciech.neubauer@intel.com,
adam.kwolek@intel.com, dan.j.williams@intel.com,
ed.ciechanowski@intel.com
Subject: Re: [PATCH 4/5] FIX: Validate input in ping_monitor function
Date: Thu, 27 Jan 2011 13:14:22 +1000 [thread overview]
Message-ID: <20110127131422.7bc7ff5e@nbeee.brown> (raw)
In-Reply-To: <20110124141728.16405.6921.stgit@gklab-128-111.igk.intel.com>
On Mon, 24 Jan 2011 15:17:29 +0100
Krzysztof Wojcik <krzysztof.wojcik@intel.com> wrote:
> For native case we do not have monitor running so we have to
> return without pinging.
> Moreover we have NULL as input parameter. We should to avoid
> segmentation fault.
I have not applied this patch or the next one.
I would rather not call ping_XXX when not needed, rather than have it
check if it was needed or not.
NeilBrown
>
> Signed-off-by: Krzysztof Wojcik <krzysztof.wojcik@intel.com>
> ---
> msg.c | 9 +++++++--
> 1 files changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/msg.c b/msg.c
> index 76e74e7..b97ebec 100644
> --- a/msg.c
> +++ b/msg.c
> @@ -206,8 +206,13 @@ int fping_monitor(int sfd)
> /* give the monitor a chance to update the metadata */
> int ping_monitor(char *devname)
> {
> - int sfd = connect_monitor(devname);
> - int err = fping_monitor(sfd);
> + int sfd, err;
> +
> + if (!devname)
> + return -1;
> +
> + sfd = connect_monitor(devname);
> + err = fping_monitor(sfd);
>
> close(sfd);
> return err;
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-raid"
> in the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2011-01-27 3:14 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-24 14:17 [PATCH 1/5] FIX: Unfreeze array if reshape_array wasn't succeded Krzysztof Wojcik
2011-01-24 14:17 ` [PATCH 2/5] Add raid1->raid0 takeover support Krzysztof Wojcik
2011-01-27 3:12 ` Neil Brown
2011-01-24 14:17 ` [PATCH 3/5] Mistake in raid1->raid5 migration Krzysztof Wojcik
2011-01-27 3:13 ` Neil Brown
2011-01-24 14:17 ` [PATCH 4/5] FIX: Validate input in ping_monitor function Krzysztof Wojcik
2011-01-27 3:14 ` Neil Brown [this message]
2011-01-24 14:17 ` [PATCH 5/5] FIX: Validate input in ping_manager function Krzysztof Wojcik
2011-01-27 3:10 ` [PATCH 1/5] FIX: Unfreeze array if reshape_array wasn't succeded Neil Brown
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=20110127131422.7bc7ff5e@nbeee.brown \
--to=neilb@suse.de \
--cc=adam.kwolek@intel.com \
--cc=dan.j.williams@intel.com \
--cc=ed.ciechanowski@intel.com \
--cc=krzysztof.wojcik@intel.com \
--cc=linux-raid@vger.kernel.org \
--cc=wojciech.neubauer@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;
as well as URLs for NNTP newsgroup(s).