Hi Maurizio,

I don't think it is necessary to check the device size in libblock - in
case someone attempts to read beyond the end of the device, the block
device server should already respond with an error code. To prevent
running the retry loop for permanent failures (such as reading beyond
the end of a device that does not support resizing [think LVM volume or
file-based bd]) I'd rather return a different error code to let
libblock know that it does not need to retry.

Otherwise the patch looks good to me except cstyle - the double
underscores in __block_get_nblocks - I think __ prefix should be used
only for compiler symbols and the function is static anyway, so it is
not necessary.

Regards,
Martin Sucha

On Sat, 28 Jun 2014 09:28:36 +0200
Maurizio Lombardi <[email protected]> wrote:
> Hi,
> 
> In the current mainline libblock implementation, if the library fails
> to read a block from the device (for example, because a filesystem is
> trying to read/write beyond the end of the device*) the code falls
> into an infinite loop where it continues to retry the I/O operation
> again and again.
> 
> This patch will prevent this by limiting the number of retries before
> giving up. Can you let me know what do you thing about it?
> 
> * the libblock library knows the total size of the device expressed in
> physical blocks.
> 
> Cheers,


_______________________________________________
HelenOS-devel mailing list
[email protected]
http://lists.modry.cz/listinfo/helenos-devel

Reply via email to