Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

scsi: storvsc: Increase the timeouts to storvsc_timeout

Currently storvsc_timeout is only used in storvsc_sdev_configure(), and
5s and 10s are used elsewhere. It turns out that rarely the 5s is not
enough on Azure, so let's use storvsc_timeout everywhere.

In case a timeout happens and storvsc_channel_init() returns an error,
close the VMBus channel so that any host-to-guest messages in the
channel's ringbuffer, which might come late, can be safely ignored.

Add a "const" to storvsc_timeout.

Cc: stable@kernel.org
Signed-off-by: Dexuan Cui <decui@microsoft.com>
Link: https://lore.kernel.org/r/1749243459-10419-1-git-send-email-decui@microsoft.com
Reviewed-by: Long Li <longli@microsoft.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

Dexuan Cui and committed by
Martin K. Petersen
b2f96656 a3da9388

+6 -4
+6 -4
drivers/scsi/storvsc_drv.c
··· 362 362 /* 363 363 * Timeout in seconds for all devices managed by this driver. 364 364 */ 365 - static int storvsc_timeout = 180; 365 + static const int storvsc_timeout = 180; 366 366 367 367 #if IS_ENABLED(CONFIG_SCSI_FC_ATTRS) 368 368 static struct scsi_transport_template *fc_transport_template; ··· 768 768 return; 769 769 } 770 770 771 - t = wait_for_completion_timeout(&request->wait_event, 10*HZ); 771 + t = wait_for_completion_timeout(&request->wait_event, storvsc_timeout * HZ); 772 772 if (t == 0) { 773 773 dev_err(dev, "Failed to create sub-channel: timed out\n"); 774 774 return; ··· 833 833 if (ret != 0) 834 834 return ret; 835 835 836 - t = wait_for_completion_timeout(&request->wait_event, 5*HZ); 836 + t = wait_for_completion_timeout(&request->wait_event, storvsc_timeout * HZ); 837 837 if (t == 0) 838 838 return -ETIMEDOUT; 839 839 ··· 1350 1350 return ret; 1351 1351 1352 1352 ret = storvsc_channel_init(device, is_fc); 1353 + if (ret) 1354 + vmbus_close(device->channel); 1353 1355 1354 1356 return ret; 1355 1357 } ··· 1670 1668 if (ret != 0) 1671 1669 return FAILED; 1672 1670 1673 - t = wait_for_completion_timeout(&request->wait_event, 5*HZ); 1671 + t = wait_for_completion_timeout(&request->wait_event, storvsc_timeout * HZ); 1674 1672 if (t == 0) 1675 1673 return TIMEOUT_ERROR; 1676 1674