Commit b3701e0e authored by Douglas Gilbert's avatar Douglas Gilbert Committed by James Bottomley

[PATCH] st.c for GET_IDLUN

A little more testing of st's SG_IO ioctl turned up a
small problem.

This is the corresponding patch that was applied to the
sd driver when it received the block layer SG_IO ioctl.

For least surprise of lk 2.4 utilities that use the
SCSI_IOCTL_GET_IDLUN and SCSI_IOCTL_GET_BUS_NUMBER
ioctls (e.g. sg_map) it is better to return the correct
values rather than 0.
parent 9fc5617d
...@@ -3408,11 +3408,17 @@ static int st_ioctl(struct inode *inode, struct file *file, ...@@ -3408,11 +3408,17 @@ static int st_ioctl(struct inode *inode, struct file *file,
goto out; goto out;
} }
up(&STp->lock); up(&STp->lock);
i = scsi_cmd_ioctl(STp->disk, cmd_in, arg); switch (cmd_in) {
if (i != -ENOTTY) case SCSI_IOCTL_GET_IDLUN:
return i; case SCSI_IOCTL_GET_BUS_NUMBER:
else break;
return scsi_ioctl(STp->device, cmd_in, (void *) arg); default:
i = scsi_cmd_ioctl(STp->disk, cmd_in, arg);
if (i != -ENOTTY)
return i;
break;
}
return scsi_ioctl(STp->device, cmd_in, (void *) arg);
out: out:
up(&STp->lock); up(&STp->lock);
......
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