RE: [PATCH 3/6] Drivers: hv: vmbus: decrease num_sc on subchannel removal

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> -----Original Message-----
> From: Vitaly Kuznetsov [mailto:vkuznets@xxxxxxxxxx]
> Sent: Tuesday, April 21, 2015 22:28
> To: KY Srinivasan
> Cc: Haiyang Zhang; devel@xxxxxxxxxxxxxxxxxxxxxx; linux-
> kernel@xxxxxxxxxxxxxxx; 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 <vkuznets@xxxxxxxxxx>
> ---
>  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

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux