Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-15-SP2:Update
qemu.22427
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.22427
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 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: Bruce Rogers <brogers@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 2240478deb6488d2947e7e9e56ef..c672e521bb2d4a1703d3b2b78adc 100644 --- a/hw/scsi/scsi-disk.c +++ b/hw/scsi/scsi-disk.c @@ -50,7 +50,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" @@ -2773,6 +2773,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 6ea04de98c04aa36aa68230a6b87..32875bedaedf25e7b0cea8363887 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; @@ -523,6 +525,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