From: Kai Makisara Date: Thu, 5 Oct 2006 19:59:46 +0000 (+0300) Subject: [SCSI] st: Fixup -ENOMEDIUM X-Git-Tag: v2.6.19-rc4~86^2~37 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=413f73272090a69e35a03c938272ec661b1d3d4c;p=linux-2.6-omap-h63xx.git [SCSI] st: Fixup -ENOMEDIUM Based on the original patch from Hannes Reinecke Fix st_open() to return -ENOMEDIUM instead of -EIO if no medium is found. Signed-off-by: Kai Makisara Signed-off-by: James Bottomley --- 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;