Skip to content

Commit

Permalink
[SCSI] st: Fixup -ENOMEDIUM
Browse files Browse the repository at this point in the history
Based on the original patch from Hannes Reinecke <hare@suse.de>

Fix st_open() to return -ENOMEDIUM instead of -EIO if no medium is
found.

Signed-off-by: Kai Makisara <kai.makisara@kolumbus.fi>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
  • Loading branch information
Kai Makisara authored and James Bottomley committed Oct 25, 2006
1 parent a24342b commit 413f732
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/scsi/st.c
Original file line number Diff line number Diff line change
Expand Up @@ -1177,7 +1177,10 @@ static int st_open(struct inode *inode, struct file *filp)
goto err_out;
if ((filp->f_flags & O_NONBLOCK) == 0 &&
retval != CHKRES_READY) {
retval = (-EIO);
if (STp->ready == NO_TAPE)
retval = (-ENOMEDIUM);
else
retval = (-EIO);
goto err_out;
}
return 0;
Expand Down

0 comments on commit 413f732

Please sign in to comment.