Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-15-SP7:GA
qemu.23253
scsi-disk-set-default-I-O-timeout-to-30-.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File scsi-disk-set-default-I-O-timeout-to-30-.patch of Package qemu.23253
From: Hannes Reinecke <hare@suse.de> Date: Tue, 10 Nov 2020 15:06:58 +0100 Subject: scsi-disk: set default I/O timeout to 30 seconds References: bsc#1178049,bsc#1194938 To align with standard linux settings we should be setting the default I/O timeout to 30 seconds, and add a lower bound of 5 seconds to avoid spurious I/O failures. Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Lin Ma <lma@suse.com> --- hw/scsi/scsi-disk.c | 4 +++- hw/scsi/scsi-generic.c | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c index 0ee2b7f09de3fbf13e0be06d2196..e0996c2f5b5a9859697cf8803738 100644 --- a/hw/scsi/scsi-disk.c +++ b/hw/scsi/scsi-disk.c @@ -51,7 +51,7 @@ #define DEFAULT_DISCARD_GRANULARITY (4 * KiB) #define DEFAULT_MAX_UNMAP_SIZE (1 * GiB) -#define DEFAULT_IO_TIMEOUT UINT_MAX /* Infinity */ +#define DEFAULT_IO_TIMEOUT 30000 /* 30 seconds */ #define DEFAULT_MAX_IO_SIZE INT_MAX /* 2 GB - 1 block */ #define TYPE_SCSI_DISK_BASE "scsi-disk-base" @@ -2792,6 +2792,8 @@ static BlockAIOCB *scsi_block_do_sgio(SCSIBlockReq *req, io_header->mx_sb_len = sizeof(r->req.sense); io_header->sbp = r->req.sense; io_header->timeout = s->qdev.io_timeout; + if (io_header->timeout < 5000) + io_header->timeout = 5000; io_header->usr_ptr = r; io_header->flags |= SG_FLAG_DIRECT_IO; trace_scsi_disk_aio_sgio_command(r->req.tag, req->cdb[0], lba, diff --git a/hw/scsi/scsi-generic.c b/hw/scsi/scsi-generic.c index 20c39d1d13e2a187b06e91f5377c..0f780b08933439575c7b8a961317 100644 --- a/hw/scsi/scsi-generic.c +++ b/hw/scsi/scsi-generic.c @@ -125,6 +125,8 @@ static int execute_command(BlockBackend *blk, r->io_header.mx_sb_len = sizeof(r->req.sense); r->io_header.sbp = r->req.sense; r->io_header.timeout = s->io_timeout; + if (r->io_header.timeout < 5000) + r->io_header.timeout = 5000; r->io_header.usr_ptr = r; r->io_header.flags |= SG_FLAG_DIRECT_IO; @@ -527,6 +529,8 @@ int scsi_SG_IO_FROM_DEV(BlockBackend *blk, uint8_t *cmd, uint8_t cmd_size, io_header.mx_sb_len = sizeof(sensebuf); io_header.sbp = sensebuf; io_header.timeout = timeout; + if (io_header.timeout < 5000) + io_header.timeout = 5000; trace_scsi_generic_ioctl_sgio_command(cmd[0], io_header.timeout); ret = blk_ioctl(blk, SG_IO, &io_header);
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor