mirror of
https://github.com/torvalds/linux.git
synced 2026-05-31 02:24:24 +02:00
scsi: st: Don't modify unknown block number in MTIOCGET
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>
This commit is contained in:
parent
9852d85ec9
commit
5bb2d6179d
|
|
@ -3756,7 +3756,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