Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966681AbbDXIkS (ORCPT ); Fri, 24 Apr 2015 04:40:18 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50642 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966633AbbDXIkP (ORCPT ); Fri, 24 Apr 2015 04:40:15 -0400 From: Vitaly Kuznetsov To: Dexuan Cui Cc: KY Srinivasan , Haiyang Zhang , "devel\@linuxdriverproject.org" , "linux-kernel\@vger.kernel.org" Subject: Re: [PATCH 3/6] Drivers: hv: vmbus: decrease num_sc on subchannel removal References: <1429626460-7947-1-git-send-email-vkuznets@redhat.com> <1429626460-7947-4-git-send-email-vkuznets@redhat.com> Date: Fri, 24 Apr 2015 10:40:12 +0200 In-Reply-To: (Dexuan Cui's message of "Fri, 24 Apr 2015 07:02:34 +0000") Message-ID: <874mo5hqc3.fsf@vitty.brq.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2107 Lines: 66 Dexuan Cui writes: >> -----Original Message----- >> From: Vitaly Kuznetsov [mailto:vkuznets@redhat.com] >> Sent: Tuesday, April 21, 2015 22:28 >> To: KY Srinivasan >> Cc: Haiyang Zhang; devel@linuxdriverproject.org; linux- >> kernel@vger.kernel.org; Dexuan Cui >> Subject: [PATCH 3/6] Drivers: hv: vmbus: decrease num_sc on subchannel >> removal >> >> It is unlikely that that host will ask us to close only one subchannel for a >> device but let's be consistent. Do both num_sc++ and num_sc-- with >> channel->lock to be on the safe side. >> >> Signed-off-by: Vitaly Kuznetsov >> --- >> drivers/hv/channel_mgmt.c | 3 ++- >> 1 file changed, 2 insertions(+), 1 deletion(-) >> >> diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c >> index b28cbdf..8b4b561 100644 >> --- a/drivers/hv/channel_mgmt.c >> +++ b/drivers/hv/channel_mgmt.c >> @@ -205,6 +205,7 @@ void hv_process_channel_removal(struct >> vmbus_channel *channel, u32 relid) >> primary_channel = channel->primary_channel; >> spin_lock_irqsave(&primary_channel->lock, flags); >> list_del(&channel->sc_list); >> + channel->num_sc--; > > Hi Vitaly, > Here it should be > primary_channel->num_sc--; Ah, of course. I'll fix and resend, thanks! > > Thanks, > -- Dexuan > >> spin_unlock_irqrestore(&primary_channel->lock, flags); >> } >> free_channel(channel); >> @@ -265,8 +266,8 @@ static void vmbus_process_offer(struct >> vmbus_channel *newchannel) >> newchannel->primary_channel = channel; >> spin_lock_irqsave(&channel->lock, flags); >> list_add_tail(&newchannel->sc_list, &channel- >> >sc_list); >> - spin_unlock_irqrestore(&channel->lock, flags); >> channel->num_sc++; >> + spin_unlock_irqrestore(&channel->lock, flags); >> } else >> goto err_free_chan; >> } >> -- >> 1.9.3 -- Vitaly -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/