Skip to content

Commit f76c508

Browse files
committed
scsi: st: Don't modify unknown block number in MTIOCGET
jira LE-2289 Rebuild_History Non-Buildable kernel-4.18.0-553.36.1.el8_10 commit-author Kai Mäkisara <[email protected]> commit 5bb2d61 Struct mtget field mt_blkno -1 means it is unknown. Don't add anything to it. Signed-off-by: Kai Mäkisara <[email protected]> Link: https://bugzilla.kernel.org/show_bug.cgi?id=219419#c14 Link: https://lore.kernel.org/r/[email protected] Reviewed-by: John Meneghini <[email protected]> Tested-by: John Meneghini <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]> (cherry picked from commit 5bb2d61) Signed-off-by: Jonathan Maple <[email protected]>
1 parent 22397ba commit f76c508

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/scsi/st.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3755,7 +3755,7 @@ static long st_ioctl(struct file *file, unsigned int cmd_in, unsigned long arg)
37553755
((STp->density << MT_ST_DENSITY_SHIFT) & MT_ST_DENSITY_MASK);
37563756
mt_status.mt_blkno = STps->drv_block;
37573757
mt_status.mt_fileno = STps->drv_file;
3758-
if (STp->block_size != 0) {
3758+
if (STp->block_size != 0 && mt_status.mt_blkno >= 0) {
37593759
if (STps->rw == ST_WRITING)
37603760
mt_status.mt_blkno +=
37613761
(STp->buffer)->buffer_bytes / STp->block_size;

0 commit comments

Comments
 (0)