mbox series

[v2,0/3] scsi: st: Device reset patches

Message ID 20241106095723.63254-1-Kai.Makisara@kolumbus.fi
Headers show
Series scsi: st: Device reset patches | expand

Message

Kai Mäkisara (Kolumbus) Nov. 6, 2024, 9:57 a.m. UTC
These three patches were developed in response to Bugzilla report
https://bugzilla.kernel.org/show_bug.cgi?id=219419

After device reset, the tape driver allows only operations tha don't
write or read anything from tape. The reason for this is that many
(most ?) drives rewind the tape after reset and the subsequent reads
or writes would not be at the tape location the user expects. Reading
and writing is allowed again when the user does something to position the
tape (e.g., rewind).

The Bugzilla report considers the case when a user, after reset, tries
to read the drive status with MTIOCGET ioctl, but it fails. MTIOCGET
does not return much useful data after reset, but it can be allowed.
MTLOAD positions the tape and it should be allowed. The second patch
adds these to the set of allowed operations after device reset. 

The first patch fixes a bug seen when developing the second patch.

V2: The third patch is added to fix a bug that resulted in not
blocking writes if reset occurs while the device file is not open.

Kai Mäkisara (3):
  scsi: st: Don't modify unknown block number in MTIOCGET
  scsi: st: Add MTIOCGET and MTLOAD to ioctls allowed after device reset
  scsi: st: New session only when Unit Attention for new tape

 drivers/scsi/st.c | 36 ++++++++++++++++++++++++++----------
 1 file changed, 26 insertions(+), 10 deletions(-)

Comments

Martin K. Petersen Nov. 7, 2024, 2:19 a.m. UTC | #1
Kai,

> These three patches were developed in response to Bugzilla report
> https://bugzilla.kernel.org/show_bug.cgi?id=219419

Applied to 6.13/scsi-staging, thanks!