diff mbox series

[2/3] scsi: st: clear was_reset when CHKRES_NEW_SESSION

Message ID 20241031010032.117296-3-jmeneghi@redhat.com (mailing list archive)
State New
Headers show
Series scsi: st: improve pos_unknown handling after reset | expand

Commit Message

John Meneghini Oct. 31, 2024, 1 a.m. UTC
Be sure to clear was_reset when ever we clear pos_unknown. If we don't
then the code in st_chk_result() will turn on pos_unknown again.

        STp->pos_unknown |= STp->device->was_reset;

This results in confusion as future commands fail unexpectedly.

Signed-off-by: John Meneghini <jmeneghi@redhat.com>
---
 drivers/scsi/st.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c
index 9c0f9779768e..e9d1cb6c8a86 100644
--- a/drivers/scsi/st.c
+++ b/drivers/scsi/st.c
@@ -1083,6 +1083,7 @@  static int check_tape(struct scsi_tape *STp, struct file *filp)
 
 	if (retval == CHKRES_NEW_SESSION) {
 		STp->pos_unknown = 0;
+		STp->device->was_reset = 0;
 		STp->partition = STp->new_partition = 0;
 		if (STp->can_partitions)
 			STp->nbr_partitions = 1; /* This guess will be updated later