From owner-freebsd-current Mon Dec 14 10:39:15 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id KAA23733 for freebsd-current-outgoing; Mon, 14 Dec 1998 10:39:15 -0800 (PST) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.26.10.9]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id KAA23717 for ; Mon, 14 Dec 1998 10:39:08 -0800 (PST) (envelope-from bde@godzilla.zeta.org.au) Received: (from bde@localhost) by godzilla.zeta.org.au (8.8.7/8.8.7) id FAA11479; Tue, 15 Dec 1998 05:39:01 +1100 Date: Tue, 15 Dec 1998 05:39:01 +1100 From: Bruce Evans Message-Id: <199812141839.FAA11479@godzilla.zeta.org.au> To: bde@zeta.org.au, mjacob@feral.com Subject: Re: Tape Driver Changes Proposed: Tape Early Warning Behaviour Cc: freebsd-current@FreeBSD.ORG Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG >> 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