From: Jason Wang <jasowang@redhat.com>
To: Dexuan Cui <decui@microsoft.com>
Cc: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org,
driverdev-devel@linuxdriverproject.org, olaf@aepfle.de,
apw@canonical.com, kys@microsoft.com, vkuznets@redhat.com,
haiyangz@microsoft.com
Subject: Re: [PATCH v2 3/3] hv: vmbus_open(): reset the channel state on ENOMEM
Date: Mon, 02 Feb 2015 09:52:04 +0008 [thread overview]
Message-ID: <1422870244.7028.7@smtp.corp.redhat.com> (raw)
In-Reply-To: <1422851820-2432-1-git-send-email-decui@microsoft.com>
On Mon, Feb 2, 2015 at 12:37 PM, Dexuan Cui <decui@microsoft.com> wrote:
> Without this patch, the state is put to CHANNEL_OPENING_STATE, and
> when
> the driver is loaded next time, vmbus_open() will fail immediately
> due to
> newchannel->state != CHANNEL_OPEN_STATE.
>
> CC: "K. Y. Srinivasan" <kys@microsoft.com>
> Signed-off-by: Dexuan Cui <decui@microsoft.com>
> ---
>
> v2: this is a RESEND.
>
> drivers/hv/channel.c | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/hv/channel.c b/drivers/hv/channel.c
> index 2978f5e..26dcf26 100644
> --- a/drivers/hv/channel.c
> +++ b/drivers/hv/channel.c
> @@ -89,9 +89,10 @@ int vmbus_open(struct vmbus_channel *newchannel,
> u32 send_ringbuffer_size,
> out = (void *)__get_free_pages(GFP_KERNEL|__GFP_ZERO,
> get_order(send_ringbuffer_size + recv_ringbuffer_size));
>
> - if (!out)
> - return -ENOMEM;
> -
> + if (!out) {
> + err = -ENOMEM;
> + goto error0;
> + }
>
> in = (void *)((unsigned long)out + send_ringbuffer_size);
>
> @@ -199,6 +200,7 @@ error0:
> free_pages((unsigned long)out,
> get_order(send_ringbuffer_size + recv_ringbuffer_size));
> kfree(open_info);
> + newchannel->state = CHANNEL_OPEN_STATE;
> return err;
> }
> EXPORT_SYMBOL_GPL(vmbus_open);
> --
> 1.9.1
Reviewed-by: Jason Wang <jasowang@redhat.com>
prev parent reply other threads:[~2015-02-02 9:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-02 4:37 Dexuan Cui
2015-02-02 9:44 ` Jason Wang [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=1422870244.7028.7@smtp.corp.redhat.com \
--to=jasowang@redhat.com \
--cc=apw@canonical.com \
--cc=decui@microsoft.com \
--cc=driverdev-devel@linuxdriverproject.org \
--cc=gregkh@linuxfoundation.org \
--cc=haiyangz@microsoft.com \
--cc=kys@microsoft.com \
--cc=linux-kernel@vger.kernel.org \
--cc=olaf@aepfle.de \
--cc=vkuznets@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome