scsi: handle report-luns failure

When report-lun fails, number of luns returned is 0.

Due to FORTH semantics of "DO ... LOOP", it will enter loop and
execute, when the counter is 0.

For this "?DO ... LOOP" should be used to solve this problem

Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
This commit is contained in:
Nikunj A Dadhania 2015-04-07 13:00:01 +10:00 committed by Alexey Kardashevskiy
parent 2ece1754f7
commit c03647c19b
1 changed files with 1 additions and 1 deletions

View File

@ -27,7 +27,7 @@
dup 8 + dup alloc-mem ( devarray devcur ndev lunarray size size+ mem )
dup rot 0 fill ( devarray devcur ndev lunarray size mem )
dup >r swap move r> ( devarray devcur ndev mem )
dup sector l@ 3 >> 0 DO ( devarray devcur ndev mem memcur )
dup sector l@ 3 >> 0 ?DO ( devarray devcur ndev mem memcur )
dup dup scsi-read-lun IF
j swap dev-generate-srplun swap x! 8 +
ELSE