Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965589AbbDXHRU (ORCPT ); Fri, 24 Apr 2015 03:17:20 -0400 Received: from mail-bl2on0125.outbound.protection.outlook.com ([65.55.169.125]:57997 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S965232AbbDXHRS convert rfc822-to-8bit (ORCPT ); Fri, 24 Apr 2015 03:17:18 -0400 X-Greylist: delayed 874 seconds by postgrey-1.27 at vger.kernel.org; Fri, 24 Apr 2015 03:17:18 EDT Authentication-Results: spf=pass (sender IP is 206.191.229.116) smtp.mailfrom=microsoft.com; redhat.com; dkim=none (message not signed) header.d=none; From: Dexuan Cui To: Vitaly Kuznetsov , KY Srinivasan CC: Haiyang Zhang , "devel@linuxdriverproject.org" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH 3/6] Drivers: hv: vmbus: decrease num_sc on subchannel removal Thread-Topic: [PATCH 3/6] Drivers: hv: vmbus: decrease num_sc on subchannel removal Thread-Index: AQHQfD9dUS1KnmZc9EGYDFAukLjvwZ1bwCGA Date: Fri, 24 Apr 2015 07:02:34 +0000 Message-ID: References: <1429626460-7947-1-git-send-email-vkuznets@redhat.com> <1429626460-7947-4-git-send-email-vkuznets@redhat.com> In-Reply-To: <1429626460-7947-4-git-send-email-vkuznets@redhat.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [141.251.57.196] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:206.191.229.116;CTRY:US;IPV:NLI;EFV:NLI;BMV:1;SFV:NSPM;SFS:(10019020)(6009001)(438002)(13464003)(199003)(189002)(164054003)(51704005)(50986999)(86612001)(1511001)(47776003)(86362001)(2950100001)(86146001)(19580405001)(77156002)(62966003)(19580395003)(6806004)(92566002)(54356999)(5001770100001)(76176999)(87936001)(2656002)(66066001)(2900100001)(23726002)(2421001)(97756001)(50466002)(102836002)(106116001)(106466001)(46406003)(16796002)(46102003)(33646002)(108616004)(24736003)(4001450100001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM2PR0301MB1327;H:064-smtp-out.microsoft.com;FPR:;SPF:Pass;MLV:sfv;A:1;MX:1;LANG:en; X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM2PR0301MB1327; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(5002010)(5005006)(3002001);SRVR:DM2PR0301MB1327;BCL:0;PCL:0;RULEID:;SRVR:DM2PR0301MB1327; X-Forefront-PRVS: 05568D1FF7 X-OriginatorOrg: microsoft.onmicrosoft.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Apr 2015 07:02:39.9742 (UTC) X-MS-Exchange-CrossTenant-Id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=72f988bf-86f1-41af-91ab-2d7cd011db47;Ip=[206.191.229.116];Helo=[064-smtp-out.microsoft.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR0301MB1327 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1948 Lines: 59 > -----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--; 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 -- 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/