Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 Dec 1998 05:39:01 +1100
From:      Bruce Evans <bde@zeta.org.au>
To:        bde@zeta.org.au, mjacob@feral.com
Cc:        freebsd-current@FreeBSD.ORG
Subject:   Re: Tape Driver Changes Proposed: Tape Early Warning Behaviour
Message-ID:  <199812141839.FAA11479@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>> I think it is a bug for write() to return -1 after sucessfully writing a
>> short count.  physio() does everything right in this area, but write(),
>> writev(), read() and readv() do everything wrong.
>>...
>> 
>> Here `auio.uio_resid != cnt' is true if some i/o was done, and in that
>> case I think we should return the amount done and discard the error code
>> (for EIO the next i/o will presumably hit the error immediately and
>> return EIO), but we only do this for a few types of errors (ones that
>> don't occur for disks or tapes).
>> 
>
>Yes, it could be fixed in this way, I suppose, but I don't believe that an
>error condition should be signalled- a signification condition that early
>warning has been reached isn't an error- at least for tape drives. What is
>it for other character devices?

Returning an error (or EOF for the read case) from the strategy routine
is the only legitimate way to stop physio().

Ttys return EIO after certain errors and than read/readv/write/writev
return the wrong value (-1/EIO) if the EIO occurred after successfully
completing some i/o.

Bruce

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199812141839.FAA11479>