Re: 2.1.109 SCSI tape weirdness

Kai M{kisara (makisara@metla.fi)
Tue, 28 Jul 1998 23:10:58 +0300 (EET DST)


On Mon, 27 Jul 1998, Jonathan Corbet wrote:

> I threw 2.1.109 onto a real-time data collection system we support last
> week. Works great except that the behavior of SCSI tapes seems to have
> changed a bit.
>
> The system has a BusLogic BT-948 SCSI controller, and an Exabyte Eliant
> drive. If you try to do things with the drive when there is *no tape*
> inside, you see the following:
>
> - The open() call succeeds just fine. Once upon a time open
> would normally return EIO in this case.
>
Opening of a non-ready SCSI tape device is now allowed because there are
ioctls that are useful even without tape (setting defaults for the device,
etc.). Actually this is allowed also in 2.0.x (the change was made
earlier).

The next change will probably be to allow opening of a non-ready
device only if O_NONBLOCK is used. Now it is code freeze and so this will
probably happen in 2.3.x.

> - If you then do a 'write (fd, buffer, nbytes)', the return value
> will be 'nbytes' and errno says 'medium not found.' The errno
> value makes perfect sense, but write should really return -1. My
> program wasn't looking at errno if the write appeared to succeed...
>
I made a test program and it returned -1 in this case (2.1.111, libc
5.4.44). The read system call return only one integer. If it is
non-negative, it is the byte count, otherwise it is the error code
(negated). In the latter case the library should return -1 and set errno.
So, this is not a kernel problem.

Kai

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html