On 06/28/2014 11:41 AM, Maurizio Lombardi wrote: > On Sat, Jun 28, 2014 at 10:52 AM, Martin Sucha <[email protected]> wrote: >> >> 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. > > Ok. > > Jakub? MartinD? Any different opinion about this point?
AFAIR, the underlying problem here was that in some cases, ie. when the BLOCK_FLAGS_NOREAD flag is used with block_get(), the library will not attempt to consult the block device and thus will not have a chance of knowing the block is over the limit. It will happily instantiate a new block beyond the end of the device and will fail only when it is too late when it tries to write such a block back to the device. Thus, it is preferable for the real offender to get a non-deferred error from block_get() rather than later in block_put() or, even worse, for someone else to get a deferred error in block_get(). Jakub _______________________________________________ HelenOS-devel mailing list [email protected] http://lists.modry.cz/listinfo/helenos-devel
