Reply with LUN busy when there is a read/write error from backend
Signed-off-by: Utkarsh Mani Tripathi <utkarsh.tripathi@mayadata.io>
This commit is contained in:
@@ -153,7 +153,7 @@ write:
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error(err)
|
log.Error(err)
|
||||||
key = MEDIUM_ERROR
|
key = MEDIUM_ERROR
|
||||||
asc = ASC_READ_ERROR
|
asc = ASC_WRITE_ERROR
|
||||||
goto sense
|
goto sense
|
||||||
}
|
}
|
||||||
log.Debugf("write data at 0x%x for length %d", offset, len(wbuf))
|
log.Debugf("write data at 0x%x for length %d", offset, len(wbuf))
|
||||||
@@ -172,7 +172,7 @@ write:
|
|||||||
if ((opcode != api.WRITE_6) && (scb[1]&0x8 != 0)) || (pg.Data[0]&0x04 == 0) {
|
if ((opcode != api.WRITE_6) && (scb[1]&0x8 != 0)) || (pg.Data[0]&0x04 == 0) {
|
||||||
if err = bs.DataSync(int64(offset), tl); err != nil {
|
if err = bs.DataSync(int64(offset), tl); err != nil {
|
||||||
key = MEDIUM_ERROR
|
key = MEDIUM_ERROR
|
||||||
asc = ASC_READ_ERROR
|
asc = ASC_WRITE_ERROR
|
||||||
goto sense
|
goto sense
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -459,7 +459,9 @@ func SBCReadWrite(host int, cmd *api.SCSICommand) api.SAMStat {
|
|||||||
|
|
||||||
err, key, asc = bsPerformCommand(dev.Storage, cmd)
|
err, key, asc = bsPerformCommand(dev.Storage, cmd)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
goto sense
|
log.Errorf("Error from backend: %v", err)
|
||||||
|
BuildSenseData(cmd, key, asc)
|
||||||
|
return api.SAMStatBusy
|
||||||
} else {
|
} else {
|
||||||
return api.SAMStatGood
|
return api.SAMStatGood
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user