Skip to content

Commit 91d0570

Browse files
committed
scsi: st: New session only when Unit Attention for new tape
jira LE-2289 Rebuild_History Non-Buildable kernel-4.18.0-553.36.1.el8_10 commit-author Kai Mäkisara <[email protected]> commit a4550b2 Currently the code starts new tape session when any Unit Attention (UA) is seen when opening the device. This leads to incorrectly clearing pos_unknown when the UA is for reset. Set new session only when the UA is for a new tape. Signed-off-by: Kai Mäkisara <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: John Meneghini <[email protected]> Tested-by: John Meneghini <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]> (cherry picked from commit a4550b2) Signed-off-by: Jonathan Maple <[email protected]>
1 parent 769a4af commit 91d0570

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/scsi/st.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -990,7 +990,10 @@ static int test_ready(struct scsi_tape *STp, int do_wait)
990990
scode = cmdstatp->sense_hdr.sense_key;
991991

992992
if (scode == UNIT_ATTENTION) { /* New media? */
993-
new_session = 1;
993+
if (cmdstatp->sense_hdr.asc == 0x28) { /* New media */
994+
new_session = 1;
995+
DEBC_printk(STp, "New tape session.");
996+
}
994997
if (attentions < MAX_ATTENTIONS) {
995998
attentions++;
996999
continue;

0 commit comments

Comments
 (0)