mirror of
https://kernel.googlesource.com/pub/scm/linux/kernel/git/stable/linux-stable.git
synced 2025-10-01 19:35:50 +10:00
scsi: st: Don't modify unknown block number in MTIOCGET
[ Upstream commit 5bb2d6179d
]
Struct mtget field mt_blkno -1 means it is unknown. Don't add anything to
it.
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-2-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>
This commit is contained in:
parent
b8283d52ed
commit
bbb47c06f0
@ -3751,7 +3751,7 @@ static long st_ioctl(struct file *file, unsigned int cmd_in, unsigned long arg)
|
||||
((STp->density << MT_ST_DENSITY_SHIFT) & MT_ST_DENSITY_MASK);
|
||||
mt_status.mt_blkno = STps->drv_block;
|
||||
mt_status.mt_fileno = STps->drv_file;
|
||||
if (STp->block_size != 0) {
|
||||
if (STp->block_size != 0 && mt_status.mt_blkno >= 0) {
|
||||
if (STps->rw == ST_WRITING)
|
||||
mt_status.mt_blkno +=
|
||||
(STp->buffer)->buffer_bytes / STp->block_size;
|
||||
|
Loading…
Reference in New Issue
Block a user