9934534 fsck.gfs2: reports master/root dinodes as unused and fixes the bitmap

Authored and Committed by rpeterso 13 years ago
    fsck.gfs2: reports master/root dinodes as unused and fixes the bitmap
    
    The problem is that the block map is not set at the point of
    time when the master and root dinodes are checked.  So fsck
    sees the discrepancy between the on-disk bitmap (which is
    correct) and the in-core blockmap (which hasn't been set
    yet for these two system dinodes).  So it complains improperly.
    
    This is a simple fix.  Long ago, I wrote a function called
    resuscitate_metalist whose purpose was to make sure dinodes
    get marked "in use" for each system dinode.  It's called by
    function check_system_inode, and by way of check_metalist.
    
    The function is called for root and master, and therefore
    all the system dinodes _within_ those directories are
    marked properly in the block map, but nothing ever bothers
    to mark the directories themselves.  (Side note: the root
    directory doesn't have system dinodes like master, so that's
    moot).
    
    The solution (this patch) is to set the block map
    accordingly, prior to the other checks.  Since those two
    dinodes have no parent, nothing else is going to do it for
    them.
    
    rhbz#642797
    
        
file modified
+10 -0