Message ID | 1491307071-19895-1-git-send-email-thuth@redhat.com |
---|---|
State | Accepted |
Headers | show |
Thomas Huth <thuth@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@redhat.com> Reviewed-by: Nikunj A Dadhania <nikunj@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@lists.ozlabs.org > https://lists.ozlabs.org/listinfo/slof
On 04/04/17 21:57, Thomas Huth wrote: > 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@redhat.com> Thanks, applied. > --- > 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 >
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
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@redhat.com> --- slof/fs/scsi-disk.fs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)