Skip to content

Commit 8db816c

Browse files
kmakisaramartinkpetersen
authored andcommitted
scsi: st: Tighten the page format heuristics with MODE SELECT
In the days when SCSI-2 was emerging, some drives did claim SCSI-2 but did not correctly implement it. The st driver first tries MODE SELECT with the page format bit set to set the block descriptor. If not successful, the non-page format is tried. The test only tests the sense code and this triggers also from illegal parameter in the parameter list. The test is limited to "old" devices and made more strict to remove false alarms. Signed-off-by: Kai Mäkisara <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Martin K. Petersen <[email protected]>
1 parent ad77ceb commit 8db816c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/scsi/st.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3104,7 +3104,9 @@ static int st_int_ioctl(struct scsi_tape *STp, unsigned int cmd_in, unsigned lon
31043104
cmd_in == MTSETDRVBUFFER ||
31053105
cmd_in == SET_DENS_AND_BLK) {
31063106
if (cmdstatp->sense_hdr.sense_key == ILLEGAL_REQUEST &&
3107-
!(STp->use_pf & PF_TESTED)) {
3107+
cmdstatp->sense_hdr.asc == 0x24 &&
3108+
(STp->device)->scsi_level <= SCSI_2 &&
3109+
!(STp->use_pf & PF_TESTED)) {
31083110
/* Try the other possible state of Page Format if not
31093111
already tried */
31103112
STp->use_pf = (STp->use_pf ^ USE_PF) | PF_TESTED;

0 commit comments

Comments
 (0)