Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 3d35386 in mainline for uspace/lib/block/block.h


Ignore:
Timestamp:
2014-07-28T20:10:01Z (6 years ago)
Author:
Maurizio Lombardi <m.lombardi85@…>
Branches:
master
Children:
c1f26834
Parents:
7eb6c96
Message:

libblock: limit the number of retries if we fail to write a block to disk.

The original behaviour is to continously retry to write a block until the
operation succeeds, this will cause the system to enter an infinite loop
if the underlying device is unable to satisfy the request.

This patch introduces an upper limit to the number of retries and discards
the block if the limit is reached.
It also fixes a bug in the block_get() function that allows the user to
try to read a block beyond the end of the device.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/block/block.h

    r7eb6c96 r3d35386  
    8181        /** Size of the block. */
    8282        size_t size;
     83        /** Number of write failures. */
     84        int write_failures;
    8385        /** Link for placing the block into the free block list. */
    8486        link_t free_link;
Note: See TracChangeset for help on using the changeset viewer.