diff options
| author | Laurence Oberman <loberman@redhat.com> | 2026-09-29 15:28:19 -0400 |
|---|---|---|
| committer | Martin K. Petersen (Oracle) <mkp@kernel.org> | 2026-10-03 10:29:48 -0400 |
| commit | 54ee0ee9bdeb7e9d3b70cc5c2bdf7e58c4423e8d (patch) | |
| tree | 05e62507b82d575cffd53c510ad0280c9096c8e4 /tools/lib/python/kdoc | |
| parent | 8d1cc285194dbcba88c136e1ff7c25cb10e38a5b (diff) | |
| download | linux-next-54ee0ee9bdeb7e9d3b70cc5c2bdf7e58c4423e8d.tar.gz linux-next-54ee0ee9bdeb7e9d3b70cc5c2bdf7e58c4423e8d.zip | |
scsi: st: Record the tape position after a successful MTLOAD
Commit 0b120edb37dc ("scsi: st: Add MTIOCGET and MTLOAD to ioctls allowed
after device reset") allows MTLOAD to clear the reset condition because the
tape location is known after MTLOAD. But the driver does not record it:
reset_state() sets the file and block numbers to -1, and do_load_unload()
leaves them there. check_tape() sets them to 0 only for a new session,
which requires a new-medium unit attention. Drives that do not report one
when the medium was already loaded (seen with IBM LTO drives) keep
reporting file/block -1 in MTIOCGET and no BOT, although the tape is at the
beginning.
After a successful load, reset the partition and the state of all
partitions, as the new-session path in check_tape() does: partition 0,
position at BOT, EOF state cleared and no pending write. Otherwise the
driver may still record the previous partition, so that a later MTSETPART
to that partition is not performed; a read after loading at EOD fails with
EIO; and a partition left in the ST_WRITING state by a partition switch in
read() or write() makes st_flush() write a filemark at the beginning of
partition 0 when the device is closed.
Fixes: 0b120edb37dc ("scsi: st: Add MTIOCGET and MTLOAD to ioctls allowed after device reset")
Suggested-by: Kai Mäkisara <Kai.Makisara@kolumbus.fi>
Assisted-by: Claude sashiko
Signed-off-by: Laurence Oberman <loberman@redhat.com>
Reviewed-by: Kai Mäkisara <kai.makisara@kolumbus.fi>
Link: https://patch.msgid.link/20260929192821.997675-3-loberman@redhat.com
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
Diffstat (limited to 'tools/lib/python/kdoc')
0 files changed, 0 insertions, 0 deletions
