#10850 NORM Future : zhashfs: use FIEMAP for detecting unused disk blocks

Zarro Boogs per Child bugtracker at laptop.org
Wed May 4 19:03:12 EDT 2011


#10850: zhashfs: use FIEMAP for detecting unused disk blocks
------------------------------------+---------------------------------------
           Reporter:  dsd           |       Owner:  dsd           
               Type:  enhancement   |      Status:  new           
           Priority:  normal        |   Milestone:  Future Release
          Component:  build-system  |     Version:  not specified 
         Resolution:                |    Keywords:                
        Next_action:  code          |    Verified:  0             
Deployment_affected:                |   Blockedby:                
           Blocking:                |  
------------------------------------+---------------------------------------

Comment(by Quozl):

 Both these problems can be fixed without using FIEMAP by changing the
 algorithm to:
  * make sparse image from /dev/zero, mke2fs, cp,
  * create a pseudo-random marker block of 4096 bytes,
  * ensure the marker is not present in the disk image, and if so try again
 with a different marker,
  * copy the disk image and use [http://dev.laptop.org/~quozl/fs-update-
 skip-unused-blocks/fill-free-blocks.c fill-free-blocks.c] (derived from
 zerofree) on each filesystem to fill free blocks with marker block,
  * in zhashfs, recognise marker blocks and omit from output.

 With this changed algorithm, there is now a risk that the loop will never
 exit ... the pseudo-random marker generation process may continue to
 generate markers that are always found in the disk image, especially if
 the disk image is large enough and the pseudo-random source is
 sufficiently lacking in randomness.  This risk is smaller than the risk of
 producing a fill pattern identical to a real data block.  The cost is
 additional build time.

 If FIEMAP is attempted, care should be taken to test that the output
 remains the same or better.  Depending on the underlying filesystem and
 the block size, some blocks may be reported in use by FIEMAP, and not
 reported in use by the existing algorithm.

 Even better would be a block device that records the block numbers of
 blocks written.

-- 
Ticket URL: <http://dev.laptop.org/ticket/10850#comment:1>
One Laptop Per Child <http://laptop.org/>
OLPC bug tracking system


More information about the Bugs mailing list