scsi: st: Small fixes
Subsystems (2)
cover scsi: st: Small fixes
Fix some small things in the st driver.
Applies to 6.15/scsi-staging
Kai Mäkisara (3):
scsi: st: Fix array overflow in st_setup()
scsi: st: ERASE does not change tape location
scsi: st: Tighten the page format heuristics with MODE SELECT
drivers/scsi/st.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
Signature · 1 line
2.43.0
PATCH 1/3 scsi: st: Fix array overflow in st_setup()
Change the array size to follow parms size instead of a fixed value.
--- drivers/scsi/st.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/st.c +1 -1
@@ -4157,7 +4157,7 @@ static void validate_options(void)*/ static int __init st_setup (char *str) { -int i, len, ints[5 ]; +int i, len, ints[ARRAY_SIZE (parms)+1 ];char *stp; stp =get_options (str,ARRAY_SIZE (ints), ints);
Signature · 1 line
2.43.0
PATCH 2/3 scsi: st: ERASE does not change tape location
In reply to Kai MäkisaraThe SCSI ERASE command erases from the current position onwards. Don't clear the position variables.
--- drivers/scsi/st.c | 1 - 1 file changed, 1 deletion(-)
drivers/scsi/st.c +0 -1
@@ -2915,7 +2915,6 @@ static int st_int_ioctl(struct scsi_tape *STp, unsigned int cmd_in, unsigned lon timeout = STp->long_timeout *8 ;DEBC_printk (STp,"Erasing tape.\n" ); - fileno = blkno = at_sm =0 ;break ;case MTSETBLK :/* Set block length */ case MTSETDENSITY :/* Set tape density */
Signature · 1 line
2.43.0
PATCH 3/3 scsi: st: Tighten the page format heuristics with MODE SELECT
In reply to Kai MäkisaraIn 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.
--- drivers/scsi/st.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/scsi/st.c +3 -1
@@ -3104,7 +3104,9 @@ static int st_int_ioctl(struct scsi_tape *STp, unsigned int cmd_in, unsigned lon cmd_in == MTSETDRVBUFFER || cmd_in == SET_DENS_AND_BLK) {if (cmdstatp->sense_hdr.sense_key ==ILLEGAL_REQUEST && - !(STp->use_pf &PF_TESTED )) { + cmdstatp->sense_hdr.asc ==0x24 && + (STp->device)->scsi_level <=SCSI_2 && + !(STp->use_pf &PF_TESTED )) {/* Try the other possible state of Page Format if not already tried */ STp->use_pf = (STp->use_pf ^USE_PF ) |PF_TESTED ;
Signature · 1 line
2.43.0
Re: [PATCH 3/3] scsi: st: Tighten the page format heuristics with MODE SELECT
Quoted 31 lines · Kai Mäkisara
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]>--- drivers/scsi/st.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/scsi/st.c +3
-2@@ -3104,7 +3104,9 @@ static int st_int_ioctl(struct scsi_tape *STp, unsigned int cmd_in, unsigned lon cmd_in == MTSETDRVBUFFER || cmd_in == SET_DENS_AND_BLK) {if (cmdstatp->sense_hdr.sense_key ==ILLEGAL_REQUEST && - !(STp->use_pf &PF_TESTED )) { + cmdstatp->sense_hdr.asc ==0x24 && + (STp->device)->scsi_level <=SCSI_2 && + !(STp->use_pf &PF_TESTED )) {/* Try the other possible state of Page Format if not already tried */ STp->use_pf = (STp->use_pf ^USE_PF ) |PF_TESTED ; --
Quoted 3 lines
2.43.0
Martin K. Petersen
AppliedKai,
Quoted 1 line
Fix some small things in the st driver.
Applied to 6.15/scsi-staging, thanks!
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering
Martin K. Petersen
AppliedQuoted 10 lines · Kai Mäkisara
Fix some small things in the st driver.
Applies to 6.15/scsi-staging
Kai Mäkisara (3):
scsi: st: Fix array overflow inst_setup()
scsi: st: ERASE does not change tape location
scsi: st: Tighten the page format heuristics with MODE SELECT[...]
Applied to 6.15/scsi-queue, thanks!
[1/3] scsi: st: Fix array overflow in st_setup()
https://git.kernel.org/mkp/scsi/c/a018d1cf990d [2/3] scsi: st: ERASE does not change tape location https://git.kernel.org/mkp/scsi/c/ad77cebf97bd [3/3] scsi: st: Tighten the page format heuristics with MODE SELECT https://git.kernel.org/mkp/scsi/c/8db816c6f176
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering