summaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorKai Makisara <Kai.Makisara@kolumbus.fi>2006-10-05 22:59:46 +0300
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2006-10-25 15:11:59 -0700
commit413f73272090a69e35a03c938272ec661b1d3d4c (patch)
treecbd35ad92c9f02436c2f498d273956337b8f08f9 /drivers/scsi
parenta24342b90c9c829fc5fea9ee01b127f81bca18ef (diff)
[SCSI] st: Fixup -ENOMEDIUM
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>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/st.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c
index 3babdc76b3f..e1a52c525ed 100644
--- a/drivers/scsi/st.c
+++ b/drivers/scsi/st.c
@@ -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;