[lkml]   [2004]   [Apr]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: dd PATCH: add conv=direct
> > If you want to add O_DIRECT support to dd then it should be implemented
> > properly, and that means implementing it for both read and write.
> >
> > In fact the user should be able to specify the read-O_DIRECT and the
> > write-O_DIRECT independently - if for no other reason than that the source
> > and dest filesytems may not both support O_DIRECT.
> Of course if both directions are supported they must be independently
> specifiable. I just don't see a compelling use case for the input side.

Andy, since I was the one who suggested adding a conv=odirect flag to the
output side, so that we could use a standard tool (dd) to force
reallocation of bad sectors by writing to them, let me argue that it ALSO
makes sense to allow O_DIRECT (as an independent option) on the input

At least one obvious use is to help FIND unreadable disk sectors (or to
verify that some sector is indeed unreadable). One would like to be able
to do:

dd if=/dev/hda of=/dev/null bs=512 count=1 skip=LBA conv=idirect

and see if the dd suceeds or fails.

If dd fails, then without having an O_DIRECT option (idirect) at the input
side, there is no way of telling if the failure was because of an
unreadable sector at LBA, or an unreadable sector somewhere else in the
block containing LBA. With the O_DIRECT input option, you can be sure that
if this command fails it's because the sector at LBA was unreadable, not
some nearby sector.


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 14:02    [W:0.100 / U:0.088 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site