Re: reading a raw device starting from end

From: Stephen C. Tweedie (sct@redhat.com)
Date: Fri Apr 21 2000 - 06:36:10 EST


Hi,

On Fri, Apr 21, 2000 at 04:30:28PM +0530, Amit S. Kale wrote:
>
> Reading a raw device starting from end returns 0.
> If you do a 'dd' to a raw device without specifying count of blocks, it writes
> to the end. After this write returns 0 which causes dd to retry the write ( Not
> sure why dd retries write ) Thus dd falls into an infinite loop.
>
> This does not happen on a block device as writing starting from end returns
> ENOSPC
>
> Should this be considered as a bug in dd or incorrect behavior of raw device
> driver?

I don't know. POSIX certainly doesn't specify exactly what to do in
this case. I never use "dd" on raw devices, as (at least on Linux) it
does not align its buffers correctly, but "lmdd" does not have the
problem you describe: it terminates correctly after a short write.

Do you know what other Unixen return in this case?

--Stephen

-
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.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Apr 23 2000 - 21:00:18 EST