From c03647c19ba22b007d0bc7543efbd806aeca5231 Mon Sep 17 00:00:00 2001 From: Nikunj A Dadhania Date: Tue, 7 Apr 2015 13:00:01 +1000 Subject: [PATCH] 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 Signed-off-by: Alexey Kardashevskiy --- slof/fs/scsi-probe-helpers.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slof/fs/scsi-probe-helpers.fs b/slof/fs/scsi-probe-helpers.fs index 262d157..6aec8b1 100644 --- a/slof/fs/scsi-probe-helpers.fs +++ b/slof/fs/scsi-probe-helpers.fs @@ -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