Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 10 Jul 2010 23:48:30 +0200
From:      "C. P. Ghost" <cpghost@cordula.ws>
To:        Patrick Donnelly <batrick@batbytes.com>
Cc:        questions@freebsd.org
Subject:   Re: Writes to Hard Disk Going Beyond Capacity
Message-ID:  <AANLkTimHOVLHPbbyOLPjV_E18WC6LpKW7T2B1AEqSy-S@mail.gmail.com>
In-Reply-To: <AANLkTin3-mZTKPQrihEE4EBQCvMhkebcv9O06rLrlWeV@mail.gmail.com>
References:  <AANLkTin9-MymICgQoSjFlKbLXN2Efm5_3r6X1lufqiCo@mail.gmail.com> <87iq4nsr3a.fsf@kobe.laptop> <AANLkTilAuZ3MkzDP5_f7ETk0wcvWR7OLYB8G4c_JVpj9@mail.gmail.com> <AANLkTilc1NdTqA91CTxINnAdtyE2ToViPdytTTnwkIm0@mail.gmail.com> <AANLkTinLsM2EEGMZEthZ95YDPnD7Ey20xbeiOR3sXWMp@mail.gmail.com> <AANLkTin3-mZTKPQrihEE4EBQCvMhkebcv9O06rLrlWeV@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Jul 10, 2010 at 11:28 PM, Patrick Donnelly <batrick@batbytes.com> wrote:
> On Sat, Jul 10, 2010 at 2:38 PM, C. P. Ghost <cpghost@cordula.ws> wrote:
>>
>> Or, to be more precise, is it possible that write(2) returns 0 for
>> some reason, perhaps because the device isn't ready and can't
>> accept more data, so it says that it wrote 0 bytes, but that you
>> are free to try again?
>
> write returning 0 appears to be the problem. That is indeed strange
> and I would guess it may be a bug?

I don't know if it is a bug at all, and if the standard isn't precise enough
and allows this. Granted, write(2) returning 0 for file descriptors that
weren't opened with O_NONBLOCK looks pretty weird, and somehow
it doesn't "feel" right.

Perhaps it happens because you're not writing to a file system (that
would catch this?) but to the raw device itself, and the raw device
behaves like a tape, a pipe, or a socket in this case? Strange indeed.

> - Patrick Donnelly

-cpghost.

-- 
Cordula's Web. http://www.cordula.ws/



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