]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
scsi: st: Add MTIOCGET and MTLOAD to ioctls allowed after device reset
authorKai Mäkisara <Kai.Makisara@kolumbus.fi>
Wed, 6 Nov 2024 09:57:22 +0000 (11:57 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 14 Dec 2024 18:51:41 +0000 (19:51 +0100)
commitf7b0fc4b570ad81eef5de4083ca2dba75c60c068
tree15e920d5f4572050a573028a6cdee1136a253b6c
parentbbb47c06f0114caeac5c1b14ba6ac5b7070b6a3f
scsi: st: Add MTIOCGET and MTLOAD to ioctls allowed after device reset

[ Upstream commit 0b120edb37dc9dd8ca82893d386922eb6b16f860 ]

Most drives rewind the tape when the device is reset. Reading and writing
are not allowed until something is done to make the tape position match the
user's expectation (e.g., rewind the tape). Add MTIOCGET and MTLOAD to
operations allowed after reset. MTIOCGET is modified to not touch the tape
if pos_unknown is non-zero. The tape location is known after MTLOAD.

Signed-off-by: Kai Mäkisara <Kai.Makisara@kolumbus.fi>
Link: https://bugzilla.kernel.org/show_bug.cgi?id=219419#c14
Link: https://lore.kernel.org/r/20241106095723.63254-3-Kai.Makisara@kolumbus.fi
Reviewed-by: John Meneghini <jmeneghi@redhat.com>
Tested-by: John Meneghini <jmeneghi@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/scsi/st.c