Updated invalid LUN handling

This commit is contained in:
Uwe Seimet 2021-07-05 10:54:47 +02:00
parent b88a24483a
commit 11a686cfd5
3 changed files with 13 additions and 4 deletions

View File

@ -986,7 +986,16 @@ void FASTCALL SASIDEV::CmdRequestSense()
LOGTRACE( "%s REQUEST SENSE Command ", __PRETTY_FUNCTION__);
DWORD lun = GetLun();
DWORD lun;
try {
lun = GetLun();
}
catch(const lunexception& e) {
LOGINFO("%s unsupported LUN %d", __PRETTY_FUNCTION__, (int)e.getlun());
// LOGICAL UNIT NOT SUPPORTED
Error(0x05, 0x25);
return;
}
ctrl.length = ctrl.unit[lun]->RequestSense(ctrl.cmd, ctrl.buffer);
ASSERT(ctrl.length > 0);
@ -1641,7 +1650,7 @@ void FASTCALL SASIDEV::ReceiveNext()
try {
Execute();
}
catch (lunexception& e) {
catch (const lunexception& e) {
LOGINFO("%s unsupported LUN %d", __PRETTY_FUNCTION__, (int)e.getlun());
// LOGICAL UNIT NOT SUPPORTED
Error(0x05, 0x25);

View File

@ -1630,7 +1630,7 @@ void FASTCALL SCSIDEV::Receive()
try {
Execute();
}
catch (lunexception& e) {
catch (const lunexception& e) {
LOGINFO("%s unsupported LUN %d", __PRETTY_FUNCTION__, (int)e.getlun());
// LOGICAL UNIT NOT SUPPORTED
Error(0x05, 0x25);

View File

@ -23,7 +23,7 @@ public:
~lunexception() { }
DWORD getlun() {
DWORD getlun() const {
return lun;
}
};