Message ID | 20241104112623.2675-2-Kai.Makisara@kolumbus.fi |
---|---|
State | Superseded |
Headers | show |
Series | scsi: st: Device reset patches | expand |
Reviewed-by: John Meneghini <jmeneghi@redhat.com> Tested-by: John Meneghini <jmeneghi@redhat.com> Looks great, please merge. On 11/4/24 06:26, Kai Mäkisara wrote: > 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> > --- > drivers/scsi/st.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c > index beb88f25dbb9..8d27e6caf027 100644 > --- a/drivers/scsi/st.c > +++ b/drivers/scsi/st.c > @@ -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;
diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c index beb88f25dbb9..8d27e6caf027 100644 --- a/drivers/scsi/st.c +++ b/drivers/scsi/st.c @@ -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;
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> --- drivers/scsi/st.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)