[Toybox] blkdiscard man page clarification

Lukas Czerner lczerner at redhat.com
Tue Apr 14 23:57:48 PDT 2020


On Wed, Apr 15, 2020 at 12:44:09PM +1000, Patrick Oppenlander wrote:
> Hi Lukas,
> 
> while writing a blkdiscard for toybox I came across a discrepancy
> between the man page and the util-linux implementation.
> 
> For the offset and length arguments, the man page states that "The
> provided value will be aligned to the device sector size", but the
> implementation does not perform any alignment and returns an error.
> 
> % blkdiscard -o 99 /dev/sdc
> blkdiscard: /dev/sdc: offset 99 is not aligned to sector size 512
> 
> To me, that behaviour makes sense.
> 
> A simple resolution would be to change the text to "The provided value
> _must_ be aligned to the device sector size".

Hi Patrick,

indeed you're right. The blkdiscard as well as kernel will check for the
sector alignment and will complain and/or fail in case the offset and/or
length is misaligned.

I don't remember if this changed in kernel, or it was this was this way
when the tool was created, but regardless it's wrong now and should be
fixed. Thanks for the report, I'll send a patch.

Thanks!
-Lukas

> 
> Kind regards,
> 
> Patrick
> 




More information about the Toybox mailing list