aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKai Makisara <Kai.Makisara@kolumbus.fi>2006-10-05 15:59:46 -0400
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2006-10-25 18:11:59 -0400
commit413f73272090a69e35a03c938272ec661b1d3d4c (patch)
treecbd35ad92c9f02436c2f498d273956337b8f08f9
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>
-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 3babdc76b3fb..e1a52c525ed4 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)
1177 goto err_out; 1177 goto err_out;
1178 if ((filp->f_flags & O_NONBLOCK) == 0 && 1178 if ((filp->f_flags & O_NONBLOCK) == 0 &&
1179 retval != CHKRES_READY) { 1179 retval != CHKRES_READY) {
1180 retval = (-EIO); 1180 if (STp->ready == NO_TAPE)
1181 retval = (-ENOMEDIUM);
1182 else
1183 retval = (-EIO);
1181 goto err_out; 1184 goto err_out;
1182 } 1185 }
1183 return 0; 1186 return 0;