Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:15.0:Ports
istgt
lu-add-sense-data-to-out-of-range-read-and-writ...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File lu-add-sense-data-to-out-of-range-read-and-write-err.patch of Package istgt
From 6beb4b34a2441dc4c3d5211ecb2fd01e35cde69b Mon Sep 17 00:00:00 2001 From: David Disseldorp <ddiss@suse.de> Date: Tue, 26 Mar 2013 18:56:32 +0100 Subject: [PATCH 04/12] lu: add sense data to out of range read and write errors ILLEGAL_REQUEST/LOGICAL BLOCK ADDRESS OUT OF RANGE. --- src/istgt_lu_disk.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git src/istgt_lu_disk.c src/istgt_lu_disk.c index 5ff5b09..2319a85 100644 --- src/istgt_lu_disk.c +++ src/istgt_lu_disk.c @@ -4069,7 +4069,13 @@ istgt_lu_disk_lbread(ISTGT_LU_DISK *spec, CONN_Ptr conn __attribute__((__unused_ maxlba, lba, len); if (lba >= maxlba || llen > maxlba || lba > (maxlba - llen)) { + uint8_t *sense_data; + size_t *sense_len; ISTGT_ERRLOG("end of media\n"); + sense_data = lu_cmd->sense_data; + sense_len = &lu_cmd->sense_data_len; + *sense_len = 0; + BUILD_SENSE(ILLEGAL_REQUEST, 0x21, 0x00); return -1; } @@ -4128,7 +4134,13 @@ istgt_lu_disk_lbwrite(ISTGT_LU_DISK *spec, CONN_Ptr conn, ISTGT_LU_CMD_Ptr lu_cm maxlba, lba, len); if (lba >= maxlba || llen > maxlba || lba > (maxlba - llen)) { + uint8_t *sense_data; + size_t *sense_len; ISTGT_ERRLOG("end of media\n"); + sense_data = lu_cmd->sense_data; + sense_len = &lu_cmd->sense_data_len; + *sense_len = 0; + BUILD_SENSE(ILLEGAL_REQUEST, 0x21, 0x00); return -1; } @@ -4188,12 +4200,18 @@ istgt_lu_disk_lbwrite_same(ISTGT_LU_DISK *spec, CONN_Ptr conn, ISTGT_LU_CMD_Ptr uint64_t nblocks; uint64_t wblocks; int64_t rc; + uint8_t *sense_data; + size_t *sense_len; + sense_data = lu_cmd->sense_data; + sense_len = &lu_cmd->sense_data_len; + *sense_len = 0; maxlba = spec->blockcnt; llen = (uint64_t) len; if (llen == 0) { if (lba >= maxlba) { ISTGT_ERRLOG("end of media\n"); + BUILD_SENSE(ILLEGAL_REQUEST, 0x21, 0x00); return -1; } llen = maxlba - lba; @@ -4208,6 +4226,7 @@ istgt_lu_disk_lbwrite_same(ISTGT_LU_DISK *spec, CONN_Ptr conn, ISTGT_LU_CMD_Ptr if (lba >= maxlba || llen > maxlba || lba > (maxlba - llen)) { ISTGT_ERRLOG("end of media\n"); + BUILD_SENSE(ILLEGAL_REQUEST, 0x21, 0x00); return -1; } -- 2.1.2
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