[SLOF] [PATCH] Fix "Unsupported PQ" problems in the scsi-disk open function

Nikunj A Dadhania nikunj at linux.vnet.ibm.com
Wed Apr 5 15:05:18 AEST 2017


Thomas Huth <thuth at redhat.com> writes:

> The open function of the scsi-disk code has a bug: If it encounters
> a Peripheral Qualifier != 0, it does not clean up the pointer to the
> INQUIRY buffer before exiting, so the stack is messed up afterwards
> and you get an ugly "Unknown Exception" before getting to the SLOF
> prompt.
> Also it's not a real error if the byte is set to 0x7f - this simply
> means that the "SCSI target device is not capable of supporting a
> peripheral device connected to this logical unit" (according to the
> SPC-3 standard). So in this case, we should not issue an error
> message, thus let's use the pointer to the INQUIRY buffer to check
> whether the PQ/PDT byte is 0x7f to fix both problems.
>
> Signed-off-by: Thomas Huth <thuth at redhat.com>

Reviewed-by: Nikunj A Dadhania <nikunj at linux.vnet.ibm.com>

> ---
>  slof/fs/scsi-disk.fs | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/slof/fs/scsi-disk.fs b/slof/fs/scsi-disk.fs
> index 9c0a9c1..97d9892 100644
> --- a/slof/fs/scsi-disk.fs
> +++ b/slof/fs/scsi-disk.fs
> @@ -323,8 +323,12 @@ CREATE cdb 10 allot
>  
>      \ Skip devices with PQ != 0
>      dup inquiry-data>peripheral c@ e0 and 0 <> IF
> -        ." SCSI-DISK: Unsupported PQ != 0" cr
> -	false EXIT
> +        \ Ignore 7f, since this simply means that the target
> +        \ is not supporting a peripheral device at this LUN.
> +        inquiry-data>peripheral c@ 7f <> IF
> +            ." SCSI-DISK: Unsupported PQ != 0" cr
> +        THEN
> +        false EXIT
>      THEN
>  
>      inquiry-data>peripheral c@ CASE
> -- 
> 1.8.3.1
>
> _______________________________________________
> SLOF mailing list
> SLOF at lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/slof



More information about the SLOF mailing list