Commit d5d9292c authored by Kai Mäkisara's avatar Kai Mäkisara Committed by James Bottomley

[PATCH] "mt-st tell" fails in 2.6.10-rc1

On Tue, 2 Nov 2004, Marc Thomas wrote:
> I've noticed that in 2.6.10-rc1 the "mt tell" command (from mt-st) fails to
> report SCSI tape position, returning "No such device". Other tape (read)
> operations appear to be ok. It worked fine in 2.6.9-rc4.

The patch at the end of this message should fix this (passes basic tests).
Someone added the ioctl to reset the SCSI device but the error handling
is not quite correct. The code in 2.6.10-rc1 allows st_ioctl to continue
unless reset succeeded. The fix allows continuation only if
scsi_nonblockable_ioctl() does not handle the ioctl (returns -ENODEV).
retval is cleared because the following code assumes it is zero unless set
to something else.
Signed-off-by: default avatarKai Makisara <kai.makisara@kolumbus.fi>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent 881ad474
...@@ -3131,8 +3131,9 @@ static int st_ioctl(struct inode *inode, struct file *file, ...@@ -3131,8 +3131,9 @@ static int st_ioctl(struct inode *inode, struct file *file,
* access to the device is prohibited. * access to the device is prohibited.
*/ */
retval = scsi_nonblockable_ioctl(STp->device, cmd_in, p, file); retval = scsi_nonblockable_ioctl(STp->device, cmd_in, p, file);
if (!scsi_block_when_processing_errors(STp->device) || !retval) if (!scsi_block_when_processing_errors(STp->device) || retval != -ENODEV)
goto out; goto out;
retval = 0;
cmd_type = _IOC_TYPE(cmd_in); cmd_type = _IOC_TYPE(cmd_in);
cmd_nr = _IOC_NR(cmd_in); cmd_nr = _IOC_NR(cmd_in);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment