Fedora Core 5 common issues and bugs

Rob van Nieuwkerk robn at berrymount.nl
Wed Mar 29 23:50:17 UTC 2006


On Wed, 29 Mar 2006 14:26:26 -0500
Peter Jones <pjones at redhat.com> wrote:

> On Wed, 2006-03-29 at 19:51 +0200, Rob van Nieuwkerk wrote:
> 
> > Sure.  Or something like this:
> > 
> > 	dd conv=idirect if=/dev/cdrom count=right_number | sha1sum
> > 
> > And if the dd used on the FC ISO does not support the O_DIRECT feature,
> > just add it.  Or write a completely trivial 10 line C program that
> > does the same.
> 
> This will almost always get you the wrong result.  At the very least,
> you need 'bs=2048 count="$(($(isosize /dev/cdrom) / 2048))"' with that,
> or you wind up doing md5sum on completely bogus data with some media.
> 
> But as it turns out, that fails the exact same way that mediacheck does.
> 
> > I really never understood why there never has been any trivial
> > work-around on the FC images for this very annoying problem.
> 
> dd does read(2) just like mediacheck does.  There isn't some spooky
> magic here.  It fails in exactly the same ways for exactly the same
> reasons.

Hi Peter,

Did you miss the O_DIRECT part ?

A read(2) on an fd opened with O_DIRECT should never lead to any readahead
by the kernel.  On the device level *only* the blocks requested by the
userspace read() are read.  Nothing more.

	greetings,
	Rob van Nieuwkerk




More information about the fedora-devel-list mailing list